diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-03 18:49:51 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-03 18:49:51 +0000 |
commit | d0003daa26b05c75d8ae8a980dc9e2412c96e856 (patch) | |
tree | 8cd0ea8189b4ec5d94a1f55e0af06a8e152bdc41 /gcc/reorg.c | |
parent | 1f9378db0446655e6360bb9c98da8493ba8e41cc (diff) | |
download | gcc-d0003daa26b05c75d8ae8a980dc9e2412c96e856.tar.gz |
PR rtl-optimization/23454
* reorg.c (relax_delay_slots): Only call invert_jump if any_condjump_p
is true.
* g++.dg/opt/pr23454.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103810 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reorg.c')
-rw-r--r-- | gcc/reorg.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/reorg.c b/gcc/reorg.c index cda716887d6..8b9d7efccfb 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -3123,10 +3123,11 @@ relax_delay_slots (rtx first) if (target_label && target_label != JUMP_LABEL (insn)) reorg_redirect_jump (insn, target_label); - /* See if this jump branches around an unconditional jump. - If so, invert this jump and point it to the target of the + /* See if this jump conditionally branches around an unconditional + jump. If so, invert this jump and point it to the target of the second jump. */ if (next && JUMP_P (next) + && any_condjump_p (insn) && (simplejump_p (next) || GET_CODE (PATTERN (next)) == RETURN) && target_label && next_active_insn (target_label) == next_active_insn (next) @@ -3172,7 +3173,7 @@ relax_delay_slots (rtx first) if (JUMP_P (insn) && (simplejump_p (insn) || GET_CODE (PATTERN (insn)) == RETURN) && (other = prev_active_insn (insn)) != 0 - && (condjump_p (other) || condjump_in_parallel_p (other)) + && any_condjump_p (other) && no_labels_between_p (other, insn) && 0 > mostly_true_jump (other, get_branch_condition (other, |