aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-09-21 10:20:39 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-09-21 10:20:39 -0400
commit683e6ccd1d25dc749a576119eb82346e352e09a4 (patch)
tree26d237e60609d15d11d11b65e37fbfd2afc5c90e
parent2c4c436ae8f1a6c4035fc33b87dd83fdf566a61a (diff)
downloadgcc-683e6ccd1d25dc749a576119eb82346e352e09a4.zip
gcc-683e6ccd1d25dc749a576119eb82346e352e09a4.tar.gz
gcc-683e6ccd1d25dc749a576119eb82346e352e09a4.tar.bz2
(jump_optimize): Try putting RETURN at end of function both at start
and at end of our optimization. From-SVN: r5376
-rw-r--r--gcc/jump.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index 229cd86..6ab071f 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -1916,6 +1916,26 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
}
}
+#ifdef HAVE_return
+ if (HAVE_return)
+ {
+ /* If we fall through to the epilogue, see if we can insert a RETURN insn
+ in front of it. If the machine allows it at this point (we might be
+ after reload for a leaf routine), it will improve optimization for it
+ to be there. We do this both here and at the start of this pass since
+ the RETURN might have been deleted by some of our optimizations. */
+ insn = get_last_insn ();
+ while (insn && GET_CODE (insn) == NOTE)
+ insn = PREV_INSN (insn);
+
+ if (insn && GET_CODE (insn) != BARRIER)
+ {
+ emit_jump_insn (gen_return ());
+ emit_barrier ();
+ }
+ }
+#endif
+
/* See if there is still a NOTE_INSN_FUNCTION_END in this function.
If so, delete it, and record that this function can drop off the end. */