This is the mail archive of the
mailing list for the GCC project.
RFA: RL78: Save the frame pointer if it is used.
- From: Nick Clifton <nickc at redhat dot com>
- To: dj at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 05 May 2015 15:41:52 +0100
- Subject: RFA: RL78: Save the frame pointer if it is used.
- Authentication-results: sourceware.org; auth=none
Below is a small patch to fix a small problem with the need_to_save()
function in the RL78 backend. It was only marking the frame pointer
register as needing a save if the frame pointer was in use. But since
the frame pointer is call-saved it needs to be saved any time it is
used, even if it is not being used as a frame pointer. This problem
has not arisen before because the frame pointer is also marked as
being fixed. But it turns out that it can still be used inside some
inline assembler, and so the prologue and epilogue code still need to
save and restore it.
Tested with no regressions on an rl78-elf toolchain.
OK to apply ?
2015-05-05 Nick Clifton <email@example.com>
* config/rl78/rl78.c (need_to_save): Save the frame pointer any
time that it is used.
--- gcc/config/rl78/rl78.c (revision 222796)
+++ gcc/config/rl78/rl78.c (working copy)
@@ -687,7 +687,8 @@
return df_regs_ever_live_p (regno);
- if (regno == FRAME_POINTER_REGNUM && frame_pointer_needed)
+ if (regno == FRAME_POINTER_REGNUM
+ && (frame_pointer_needed || df_regs_ever_live_p (regno)))