Patch Fix PR32871 -- [avr] gcc is pushing too many registers

Andy H hutchinsonandy@aim.com
Sun Mar 2 23:50:00 GMT 2008


The attached patch fixs:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32871

Although the bug is against the AVR target it  reveals a weakness in 
using df_regs_ever_live_p.
to determine register to save and restore that may apply to other targets.

The fix determines which registers are used as arguments to function using
INIT_CUMULATIVE_ARGS, FUNCTION_ARG and FUNCTION_ARG_ADVANCE
(This is patch is thus relatively portable for other targets)

The argument registers  are then omitted from epilog/prolog save and 
restores
(as all argument registers are assumed clobbered.)

Tested against HEAD and had no new regression for torture/execute testsuite.
Please review with the intention of committing this chnage for avr target.


2000-03-02  Andrew Hutchinson <hutchinsonandy@aim.com>

    PR target/32871
    * config/avr/avr.c (avr_args): Add new function to set argument
    registers in bitmap.
    (avr_regs_to_save): Don't mark argument registers for saving.
    (sequent_regs_live): Add bitmap argument. Use bitmap to determine
    sequence of registers.
    (expand_prologue): Pass bitmap of registers for sequence.
    (expand_epilogue): Pass bitmap of registers for sequence.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fixpush.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080302/92f1b3f1/attachment.ksh>


More information about the Gcc-patches mailing list