* [pushed][LRA]: Fix sparc bootstrap after recent patch for fp elimination for avr LRA port
@ 2023-07-22 0:34 Vladimir Makarov
0 siblings, 0 replies; only message in thread
From: Vladimir Makarov @ 2023-07-22 0:34 UTC (permalink / raw)
To: gcc-patches, Rainer Orth
[-- Attachment #1: Type: text/plain, Size: 190 bytes --]
The following patch fixes sparc solaris bootstrap. The explanation of
the patch is in the commit message.
The patch was successfully bootstrap on x86-64, aarch64, and sparc64
solaris.
[-- Attachment #2: z --]
[-- Type: text/plain, Size: 1918 bytes --]
commit d17be8f7f36abe257a7d026dad61e5f8d14bdafc
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date: Fri Jul 21 20:28:50 2023 -0400
[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.
diff --git a/gcc/lra-eliminations.cc b/gcc/lra-eliminations.cc
index cf0aa94b69a..1f4e3fec9e0 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 < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++)
if (ep->from == FRAME_POINTER_REGNUM && ep->to == STACK_POINTER_REGNUM)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-07-22 0:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-22 0:34 [pushed][LRA]: Fix sparc bootstrap after recent patch for fp elimination for avr LRA port Vladimir Makarov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).