aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2020-12-05 18:26:24 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2020-12-05 18:26:24 +0000
commit4ec78ef4837eab9b7ce3f20d7f7b39c8a2f1e41c (patch)
tree849341c4ef855611a99fe611ab7de89fbcfa2777
parenta2bd4e52cf710924107b08daaf3d09d7798c8022 (diff)
downloadgcc-4ec78ef4837eab9b7ce3f20d7f7b39c8a2f1e41c.zip
gcc-4ec78ef4837eab9b7ce3f20d7f7b39c8a2f1e41c.tar.gz
gcc-4ec78ef4837eab9b7ce3f20d7f7b39c8a2f1e41c.tar.bz2
sel-sched-ir: Add missing call to `onlyjump_p'
Do not try to remove a conditional jump if it has side effects. gcc/ * sel-sched-ir.c (maybe_tidy_empty_bb): Only try to remove a conditional jump if `onlyjump_p'.
-rw-r--r--gcc/sel-sched-ir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index c8e086e..2bcd398 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -3793,7 +3793,8 @@ maybe_tidy_empty_bb (basic_block bb)
else if (single_succ_p (pred_bb) && any_condjump_p (BB_END (pred_bb)))
{
/* If possible, try to remove the unneeded conditional jump. */
- if (INSN_SCHED_TIMES (BB_END (pred_bb)) == 0
+ if (onlyjump_p (BB_END (pred_bb))
+ && INSN_SCHED_TIMES (BB_END (pred_bb)) == 0
&& !IN_CURRENT_FENCE_P (BB_END (pred_bb)))
{
if (!sel_remove_insn (BB_END (pred_bb), false, false))