aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1993-07-10 17:48:56 -0600
committerJeff Law <law@gcc.gnu.org>1993-07-10 17:48:56 -0600
commit8e318904de7104de65f093a0abfdd23abc9224be (patch)
tree9d403d51593035e08eeece5509c1dd6514233eee
parent0d8c1ccd98a08f6e2dedaf2d86dd615b004d7543 (diff)
downloadgcc-8e318904de7104de65f093a0abfdd23abc9224be.zip
gcc-8e318904de7104de65f093a0abfdd23abc9224be.tar.gz
gcc-8e318904de7104de65f093a0abfdd23abc9224be.tar.bz2
jump.c (jump_optimize): Correctly identify branches to the end of a function so that they may be turned...
* jump.c (jump_optimize): Correctly identify branches to the end of a function so that they may be turned into RETURN insns. From-SVN: r4903
-rw-r--r--gcc/jump.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index 9773ce6..4025d8b 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -641,7 +641,9 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
/* If a jump references the end of the function, try to turn
it into a RETURN insn, possibly a conditional one. */
if (JUMP_LABEL (insn)
- && next_active_insn (JUMP_LABEL (insn)) == 0)
+ && (next_active_insn (JUMP_LABEL (insn)) == 0
+ || GET_CODE (PATTERN (next_active_insn (JUMP_LABEL (insn))))
+ == RETURN))
changed |= redirect_jump (insn, NULL_RTX);
/* Detect jump to following insn. */