aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir N. Makarov <vmakarov@redhat.com>2023-07-21 20:28:50 -0400
committerVladimir N. Makarov <vmakarov@redhat.com>2023-07-21 20:29:55 -0400
commit16894253cd152dd8e02ba48708ec8ec0a9f99e24 (patch)
tree9f0eaa565da04a3d9906dec393ab496ef8b13a9b
parent0ce6353046ec3fccc16bb6465f8a7f3eb00547fa (diff)
downloadgcc-16894253cd152dd8e02ba48708ec8ec0a9f99e24.zip
gcc-16894253cd152dd8e02ba48708ec8ec0a9f99e24.tar.gz
gcc-16894253cd152dd8e02ba48708ec8ec0a9f99e24.tar.bz2
[LRA]: Fix sparc bootstrap after recent patch for fp elimination for avr LRA port
The recent patch for fp elimination for avr LRA port modified an assert which can be wrong for targets using hard frame pointer different from frame pointer. Also for such ports spilling pseudos assigned to fp was wrong too in the new code. Although this code is not used for any target currently using LRA except for avr. Given patch fixes the issues. gcc/ChangeLog: * lra-eliminations.cc (update_reg_eliminate): Fix the assert. (lra_update_fp2sp_elimination): Use HARD_FRAME_POINTER_REGNUM instead of FRAME_POINTER_REGNUM to spill pseudos.
-rw-r--r--gcc/lra-eliminations.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/lra-eliminations.cc b/gcc/lra-eliminations.cc
index cf0aa94..1f4e3fe 100644
--- a/gcc/lra-eliminations.cc
+++ b/gcc/lra-eliminations.cc
@@ -1179,8 +1179,7 @@ update_reg_eliminate (bitmap insns_with_changed_offsets)
gcc_assert (ep->to_rtx != stack_pointer_rtx
|| (ep->from == FRAME_POINTER_REGNUM
&& !elimination_fp2sp_occured_p)
- || (ep->from != FRAME_POINTER_REGNUM
- && ep->from < FIRST_PSEUDO_REGISTER
+ || (ep->from < FIRST_PSEUDO_REGISTER
&& fixed_regs [ep->from]));
/* Mark that is not eliminable anymore. */
@@ -1398,7 +1397,7 @@ lra_update_fp2sp_elimination (void)
" Frame pointer can not be eliminated anymore\n");
frame_pointer_needed = true;
CLEAR_HARD_REG_SET (set);
- add_to_hard_reg_set (&set, Pmode, FRAME_POINTER_REGNUM);
+ add_to_hard_reg_set (&set, Pmode, HARD_FRAME_POINTER_REGNUM);
spill_pseudos (set);
for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
if (ep->from == FRAME_POINTER_REGNUM && ep->to == STACK_POINTER_REGNUM)