Patch (rs6000): Do not save/restore user-defined global registers

Dale Johannesen dalej@apple.com
Fri Jun 3 17:46:00 GMT 2005


The documentation is clear that the prologue/epilogue is not supposed 
to save and
restore user-defined global registers.  As far as I can see this has 
never worked on rs6000;
we were not considering globals when deciding whether to use stmw/lmw.
Along the way I found that Darwin was marking the PIC register as a 
user-defined
global.  This dates back to the original Darwin checkin, and may have 
been necessary
at that time as a workaround for some other bug, but it's wrong and 
doesn't seem to
be needed now.  Bootstrapped and tested.

(Is the syntax "r29" in the test case acceptable to all targets?  if 
not, what do I need to use?)

2005-06-03  Dale Johannesen  <dalej@apple.com>

         * config/rs6000/rs6000.c (no_global_regs_above): New.
         (rs6000_emit_prologue):  Use it; cosmetic formatting fixes.
         (rs6000_emit_epilogue):  Use it; cosmetic formatting fixes.
         (rs6000_conditional_register_usage): Don't put Darwin PIC
         register in global_regs.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs8a.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050603/c82a7ae6/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 20050603-1.c
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050603/c82a7ae6/attachment.c>
-------------- next part --------------



More information about the Gcc-patches mailing list