Hi Richard,
Have you tried using CALL_REALLY_USED_REGISTERS? I.e. define
CALL_REALLY_USED_REGISTERS to be the same as CALL_USED_REGISTERS,
except that the former marks a2 as call-saved.
I had not considered this (because I did not know of the existence of
the macro), but you are right, it is a good idea.
So Jeff, Alex - here is a third version of the patch, using Richard's
suggestion and updating the code in mn10300.c to check the
call_really_used[] array rather than the call_used[] array. Tested
with an mn10300-elf toolchain with no regressions in the gcc testsuite
and a lot of improvements for the results when compiling with -fpic.
May I apply this version of the patch please ?
Cheers
Nick
gcc/ChangeLog
2008-10-27 Nick Clifton <nickc@redhat.com>
* config/mn10300/mn10300.h (CALL_REALLY_USED_REGISTERS): Define.
* config/mn10300/mn10300.c (fp_regs_to_save): Test the
call_really_used_regs array rather than the call_used_regs array.
(mn10300_get_live_callee_saved_regs, expand_prologue,
expand_epilogue, output_tst): Likewise.