]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[LRA]: Fix elimination recognition for INC/DEC RTL
authorVladimir N. Makarov <vmakarov@redhat.com>
Tue, 28 Apr 2026 13:02:13 +0000 (09:02 -0400)
committerVladimir N. Makarov <vmakarov@redhat.com>
Tue, 28 Apr 2026 18:09:59 +0000 (14:09 -0400)
There is a typo when we processing {PRE,POST}_{INC,DEC} and
{PRE,POST}_MODIFY to prevent elimination of hard reg operand.  The
condition actually makes to consider pseudos instead of hard reg.  The
patch fixes this.

gcc/ChangeLog:

* lra-eliminations.cc (mark_not_eliminable): Fix condition to
consider hard regs instead of pseudos for INC/DEC/MODIFY operands.

gcc/lra-eliminations.cc

index e2a6ebfff1607a027d9f870b942c26253ab5da0e..84954d5bd1c8fcc394fc9dc1a9b6d9134d57e889 100644 (file)
@@ -801,7 +801,7 @@ mark_not_eliminable (rtx x, machine_mode mem_mode)
            curr_sp_change += offset;
        }
       else if (REG_P (XEXP (x, 0))
-              && REGNO (XEXP (x, 0)) >= FIRST_PSEUDO_REGISTER)
+              && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER)
        {
          /* If we modify the source of an elimination rule, disable
             it.  Do the same if it is the destination and not the