https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120165
--- Comment #20 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Vladimir Makarov <[email protected]>: https://gcc.gnu.org/g:d9d70a5fbbe25ddbed66c05b9ec04fe97a23059f commit r17-2364-gd9d70a5fbbe25ddbed66c05b9ec04fe97a23059f Author: Vladimir N. Makarov <[email protected]> Date: Mon Jul 13 15:16:45 2026 -0400 [PR120165, LRA]: Prevent equivalence substitution resulting in wrong reloads The PR is about wrong generation of insn involving memory-memory move with sp predecrement, another address post-increment, and input and output memory reloads with the address reg eliminated to sp. As elimination offset is updated in LRA once per insn, the output reload insn uses the wrong offset. As implementation of the separate offset updates requires a lot of changes in LRA code and using equivalence (a memory) actually is not profitable, we just prevent equivalence substitution in such cases. There is no test case for the patch as m68k port is in transition to LRA and it requires -mlra option which will be probably removed. gcc/ChangeLog: PR target/120165 * lra-constraints.cc (virtual_reg_p, contains_virtual_reg_p): New. (reg_has_incdec_p): Ditto. (lra_constraints): Use reg_has_incdec_p and contains_virtual_reg_p to switch off the equiv.
