diff mbox series

[3/6] sel-sched-ir: Add missing call to `onlyjump_p'

Message ID alpine.LFD.2.21.2012031050300.656242@eddie.linux-mips.org
State Accepted
Headers show
Series Add missing calls to `onlyjump_p' | expand

Commit Message

Maciej W. Rozycki Dec. 3, 2020, 11:34 a.m. UTC
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 |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

gcc-sel-sched-ir-empty-bb-only-jump.diff

Comments

Jeff Law Dec. 3, 2020, 10:02 p.m. UTC | #1
On 12/3/20 4:34 AM, Maciej W. Rozycki wrote:
> 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'.
OK
jeff
diff mbox series

Patch

Index: gcc/gcc/sel-sched-ir.c
===================================================================
--- gcc.orig/gcc/sel-sched-ir.c
+++ gcc/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))