sel-sched-ir: Add missing call to `onlyjump_p'
authorMaciej W. Rozycki <macro@linux-mips.org>
Sat, 5 Dec 2020 18:26:24 +0000 (18:26 +0000)
committerMaciej W. Rozycki <macro@linux-mips.org>
Sat, 5 Dec 2020 18:26:24 +0000 (18:26 +0000)
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'.

gcc/sel-sched-ir.c

index c8e086e49507e0360079631b8f84a71a5760871f..2bcd398391b4d32d77bf9a2b858030b7487cbc3a 100644 (file)
@@ -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))