summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-11 21:35:02 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-11 21:35:02 +0000
commit62dcb5c89136585c8600e09979def634a9e776bd (patch)
tree522fb7178bd1e83bdba8ab6c8d0264247db8c3a3
parentc9b99c30900d0bb11f7b4f86cb0fab35d41059a8 (diff)
downloadgcc-62dcb5c89136585c8600e09979def634a9e776bd.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208498 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/builtins.c36
-rw-r--r--gcc/cse.c5
-rw-r--r--gcc/cselib.c6
-rw-r--r--gcc/dse.c10
5 files changed, 32 insertions, 33 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d1b7a502361..5993f2dd316 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2014-03-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * 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.
+
2014-03-11 Joern Rennecke <joern.rennecke@embecosm.com>
* config/arc/arc.c (conditionalize_nonjump): New function, broken
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 7c6318ee4ab..e4846c8e6d7 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 ());
}
diff --git a/gcc/cse.c b/gcc/cse.c
index dba85f1891c..852d13ebf5b 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -5682,11 +5682,6 @@ cse_insn (rtx insn)
invalidate (XEXP (dest, 0), GET_MODE (dest));
}
- /* A volatile ASM or an UNSPEC_VOLATILE invalidates everything. */
- if (NONJUMP_INSN_P (insn)
- && volatile_insn_p (PATTERN (insn)))
- flush_hash_table ();
-
/* Don't cse over a call to setjmp; on some machines (eg VAX)
the regs restored by the longjmp come from a later time
than the setjmp. */
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 4dfc55778b9..26bcbe07769 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -2645,12 +2645,10 @@ cselib_process_insn (rtx insn)
cselib_current_insn = insn;
- /* Forget everything at a CODE_LABEL, a volatile insn, or a setjmp. */
+ /* Forget everything at a CODE_LABEL or a setjmp. */
if ((LABEL_P (insn)
|| (CALL_P (insn)
- && find_reg_note (insn, REG_SETJMP, NULL))
- || (NONJUMP_INSN_P (insn)
- && volatile_insn_p (PATTERN (insn))))
+ && find_reg_note (insn, REG_SETJMP, NULL)))
&& !cselib_preserve_constants)
{
cselib_reset_table (next_uid);
diff --git a/gcc/dse.c b/gcc/dse.c
index f5c9c7376ea..09dc5df6e93 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -2470,16 +2470,6 @@ scan_insn (bb_info_t bb_info, rtx insn)
return;
}
- /* Cselib clears the table for this case, so we have to essentially
- do the same. */
- if (NONJUMP_INSN_P (insn)
- && volatile_insn_p (PATTERN (insn)))
- {
- add_wild_read (bb_info);
- insn_info->cannot_delete = true;
- return;
- }
-
/* Look at all of the uses in the insn. */
note_uses (&PATTERN (insn), check_mem_read_use, bb_info);