From 102b3cc3738f5db788134989bdc93b817316f320 Mon Sep 17 00:00:00 2001 From: "Vladimir N. Makarov" Date: Tue, 28 Apr 2026 09:02:13 -0400 Subject: [PATCH] [LRA]: Fix elimination recognition for INC/DEC RTL 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/lra-eliminations.cc b/gcc/lra-eliminations.cc index e2a6ebfff16..84954d5bd1c 100644 --- a/gcc/lra-eliminations.cc +++ b/gcc/lra-eliminations.cc @@ -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 -- 2.47.3