aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1993-09-30 21:23:10 -0600
committerJeff Law <law@gcc.gnu.org>1993-09-30 21:23:10 -0600
commit0e5bad531b3ab78b6a4fd88e80db6232fe460107 (patch)
treed5ee58bbeee6d229a3cec1a73ff8484f6755b2d4
parent56ae2659f7473989e070ba6857cb5fdd8bf3958e (diff)
downloadgcc-0e5bad531b3ab78b6a4fd88e80db6232fe460107.zip
gcc-0e5bad531b3ab78b6a4fd88e80db6232fe460107.tar.gz
gcc-0e5bad531b3ab78b6a4fd88e80db6232fe460107.tar.bz2
reorg.c (optimize_skip): Do not thread a jump to a new target if doing so would invalidate the insn in...
* reorg.c (optimize_skip): Do not thread a jump to a new target if doing so would invalidate the insn in the jump's delay slot. From-SVN: r5540
-rw-r--r--gcc/reorg.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 341383d..547cba9 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -1157,7 +1157,14 @@ optimize_skip (insn)
target_label = JUMP_LABEL (next_trial);
if (target_label == 0)
target_label = find_end_label ();
- reorg_redirect_jump (insn, target_label);
+
+ /* Recompute the flags based on TARGET_LABEL since threading
+ the jump to TARGET_LABEL may change the direction of the
+ jump (which may change the circumstances in which the
+ delay slot is nullified). */
+ flags = get_jump_flags (insn, target_label);
+ if (eligible_for_annul_true (insn, 0, trial, flags))
+ reorg_redirect_jump (insn, target_label);
}
INSN_ANNULLED_BRANCH_P (insn) = 1;