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.