https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115462
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by hongtao Liu <liuho...@gcc.gnu.org>: https://gcc.gnu.org/g:b8153b5417bed02f47354a14ad36100785dfdc47 commit r15-1673-gb8153b5417bed02f47354a14ad36100785dfdc47 Author: liuhongt <hongtao....@intel.com> Date: Mon Jun 24 17:53:22 2024 +0800 Fix wrong cost of MEM when addr is a lea. 416.gamess regressed 4-6% on x86_64 since my r15-882-g1d6199e5f8c1c0. The commit adjust rtx_cost of mem to reduce cost of (add op0 disp). But Cost of ADDR could be cheaper than XEXP (addr, 0) when it's a lea. It is the case in the PR, the patch adjust rtx_cost to only handle reg + disp, for other forms, they're basically all LEA which doesn't have additional cost of ADD. gcc/ChangeLog: PR target/115462 * config/i386/i386.cc (ix86_rtx_costs): Make cost of MEM (reg + disp) just a little bit more than MEM (reg). gcc/testsuite/ChangeLog: * gcc.target/i386/pr115462.c: New test.