summaryrefslogtreecommitdiff
path: root/gcc/reorg.c
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1994-07-01 17:29:06 -0600
committerJeff Law <law@gcc.gnu.org>1994-07-01 17:29:06 -0600
commit18beb3e99697d66f252e98d717fcdfb14b1f1403 (patch)
tree7c9a2fced2c49f781b2ff9318c4b427b5cd457a7 /gcc/reorg.c
parent8743ede9fbe9b575a953459f21852dd3cf85bbc0 (diff)
downloadgcc-18beb3e99697d66f252e98d717fcdfb14b1f1403.tar.gz
reorg.c (make_return_insns): Make sure redirecting a jump to a RETURN insn does not invalidate the delay...
* reorg.c (make_return_insns): Make sure redirecting a jump to a RETURN insn does not invalidate the delay slots of the jump. From-SVN: r7639
Diffstat (limited to 'gcc/reorg.c')
-rw-r--r--gcc/reorg.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 343f4b7035d..4082ad8de51 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -3980,11 +3980,16 @@ make_return_insns (first)
pat = PATTERN (insn);
jump_insn = XVECEXP (pat, 0, 0);
- /* If we can't make the jump into a RETURN, redirect it to the best
+ /* If we can't make the jump into a RETURN, try to redirect it to the best
RETURN and go on to the next insn. */
if (! reorg_redirect_jump (jump_insn, NULL_RTX))
{
- reorg_redirect_jump (jump_insn, real_return_label);
+ /* Make sure redirecting the jump will not invalidate the delay
+ slot insns. */
+ if (redirect_with_delay_slots_safe_p (jump_insn,
+ real_return_label,
+ insn))
+ reorg_redirect_jump (jump_insn, real_return_label);
continue;
}