aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2014-03-11 21:35:02 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2014-03-11 21:35:02 +0000
commitf12572682e4b112bb61fe05ec233cb63bb261604 (patch)
tree522fb7178bd1e83bdba8ab6c8d0264247db8c3a3 /gcc/builtins.c
parent5af1876c657286423edbf631be14a36ce2dcaeaa (diff)
downloadgcc-f12572682e4b112bb61fe05ec233cb63bb261604.zip
gcc-f12572682e4b112bb61fe05ec233cb63bb261604.tar.gz
gcc-f12572682e4b112bb61fe05ec233cb63bb261604.tar.bz2
builtins.c (expand_builtin_setjmp_receiver): Use and clobber hard_frame_pointer_rtx.
gcc/ * builtins.c (expand_builtin_setjmp_receiver): Use and clobber hard_frame_pointer_rtx. * cse.c (cse_insn): Remove volatile check. * cselib.c (cselib_process_insn): Likewise. * dse.c (scan_insn): Likewise. From-SVN: r208498
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 7c6318e..e4846c8 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -910,18 +910,27 @@ expand_builtin_setjmp_receiver (rtx receiver_label ATTRIBUTE_UNUSED)
#ifdef HAVE_nonlocal_goto
if (! HAVE_nonlocal_goto)
#endif
- /* First adjust our frame pointer to its actual value. It was
- previously set to the start of the virtual area corresponding to
- the stacked variables when we branched here and now needs to be
- adjusted to the actual hardware fp value.
-
- Assignments to virtual registers are converted by
- instantiate_virtual_regs into the corresponding assignment
- to the underlying register (fp in this case) that makes
- the original assignment true.
- So the following insn will actually be decrementing fp by
- STARTING_FRAME_OFFSET. */
- emit_move_insn (virtual_stack_vars_rtx, hard_frame_pointer_rtx);
+ {
+ /* First adjust our frame pointer to its actual value. It was
+ previously set to the start of the virtual area corresponding to
+ the stacked variables when we branched here and now needs to be
+ adjusted to the actual hardware fp value.
+
+ Assignments to virtual registers are converted by
+ instantiate_virtual_regs into the corresponding assignment
+ to the underlying register (fp in this case) that makes
+ the original assignment true.
+ So the following insn will actually be decrementing fp by
+ STARTING_FRAME_OFFSET. */
+ emit_move_insn (virtual_stack_vars_rtx, hard_frame_pointer_rtx);
+
+ /* Restoring the frame pointer also modifies the hard frame pointer.
+ Mark it used (so that the previous assignment remains live once
+ the frame pointer is eliminated) and clobbered (to represent the
+ implicit update from the assignment). */
+ emit_use (hard_frame_pointer_rtx);
+ emit_clobber (hard_frame_pointer_rtx);
+ }
#if !HARD_FRAME_POINTER_IS_ARG_POINTER
if (fixed_regs[ARG_POINTER_REGNUM])
@@ -965,8 +974,7 @@ expand_builtin_setjmp_receiver (rtx receiver_label ATTRIBUTE_UNUSED)
/* We must not allow the code we just generated to be reordered by
scheduling. Specifically, the update of the frame pointer must
- happen immediately, not later. Similarly, we must block
- (frame-related) register values to be used across this code. */
+ happen immediately, not later. */
emit_insn (gen_blockage ());
}