This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[new-ra] Make ppc64 bootstrap
- From: Michael Matz <matz at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 16 Oct 2003 21:08:23 +0200 (CEST)
- Subject: [new-ra] Make ppc64 bootstrap
Hi,
some architectures (ppc64 in this case) can't caller-save some registers
although they are in call_used (the condition codes for example). We
didn't remove them from consideration for pseudos live over calls and
generated bad code.
Now I can bootstrap this on ppc64 (only tested C frontend, but the
bootstrap with all langs is already in the runtime libs (no Ada, though)).
Also bootstrapped on x86.
Ciao,
Michael.
--
* ra-build.c (select_regclass): Subtract call_fixed_regs &
call_used_regs).
Index: ra-build.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ra-build.c,v
retrieving revision 1.1.2.22
diff -u -p -r1.1.2.22 ra-build.c
--- ra-build.c 15 Oct 2003 18:13:29 -0000 1.1.2.22
+++ ra-build.c 16 Oct 2003 17:41:52 -0000
@@ -3012,10 +3012,20 @@ select_regclass ()
{
unsigned int num_refs = web->num_uses + web->num_defs;
unsigned int num_calls = web->num_calls;
+ HARD_REG_SET s;
+ /* Remove also those regs which aren't caller-save, but
+ for which we are unable to generate the necessary
+ mem-reg moves in caller-save.c. */
if (!flag_caller_saves
|| !CALLER_SAVE_PROFITABLE (num_refs, num_calls))
AND_COMPL_HARD_REG_SET (web->usable_regs,
regs_invalidated_by_call);
+ /* call_fixed_reg_set includes also non call-used regs
+ (in fact all of them). We don't want to subtract
+ those. */
+ COPY_HARD_REG_SET (s, call_fixed_reg_set);
+ AND_HARD_REG_SET (s, call_used_reg_set);
+ AND_COMPL_HARD_REG_SET (web->usable_regs, s);
}
if (web->live_over_abnormal)
AND_COMPL_HARD_REG_SET (web->usable_regs, regs_invalidated_by_call);