This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Remove r2 from call_really_used_regs[]
Thanks for implementing this.
A few comments about the patch: The change deserves a comment in
the code. The filename in ChangeLog entries should include the entire
path relative to the ChangeLog file, e.g., config/rs6000/rs6000.c. Some
mention of PowerPC in the subject line would have made it more obvious
that it was a target-specific patch. Appended is what I applied.
Thanks, David
2005-06-03 Pat Haugen <pthaugen@us.ibm.com>
* config/rs6000/rs6000.c (rs6000_conditional_register_usage):
Clear call_realy_used_regs[r2] when ABI_AIX.
Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.830
retrieving revision 1.831
diff -c -p -r1.830 -r1.831
*** rs6000.c 2 Jun 2005 14:19:18 -0000 1.830
--- rs6000.c 3 Jun 2005 17:18:04 -0000 1.831
*************** rs6000_conditional_register_usage (void)
*** 3298,3303 ****
--- 3298,3308 ----
fixed_regs[i] = call_used_regs[i]
= call_really_used_regs[i] = 1;
+ /* The TOC register is not killed across calls in a way that is
+ visible to the compiler. */
+ if (DEFAULT_ABI == ABI_AIX)
+ call_really_used_regs[2] = 0;
+
if (DEFAULT_ABI == ABI_V4
&& PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
&& flag_pic == 2)