diff mbox series

[5/6] loop-doloop: Add missing call to `onlyjump_p'

Message ID alpine.LFD.2.21.2012031100220.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:35 a.m. UTC
Keep any jump that has side effects as those must not be removed.

	gcc/
	* loop-doloop.c (add_test): Only remove the jump if `onlyjump_p'.
---
 gcc/loop-doloop.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

gcc-loop-doloop-add-test-only-jump.diff

Comments

Jeff Law Dec. 3, 2020, 10:03 p.m. UTC | #1
On 12/3/20 4:35 AM, Maciej W. Rozycki wrote:
> Keep any jump that has side effects as those must not be removed.
>
> 	gcc/
> 	* loop-doloop.c (add_test): Only remove the jump if `onlyjump_p'.
OK
jeff
Jeff Law Dec. 3, 2020, 10:04 p.m. UTC | #2
On 12/3/20 4:35 AM, Maciej W. Rozycki wrote:
> Keep any jump that has side effects as those must not be removed.
>
> 	gcc/
> 	* loop-doloop.c (add_test): Only remove the jump if `onlyjump_p'.
OK
jeff
diff mbox series

Patch

Index: gcc/gcc/loop-doloop.c
===================================================================
--- gcc.orig/gcc/loop-doloop.c
+++ gcc/gcc/loop-doloop.c
@@ -378,7 +378,7 @@  add_test (rtx cond, edge *e, basic_block
   bb = split_edge_and_insert (*e, seq);
   *e = single_succ_edge (bb);
 
-  if (any_uncondjump_p (jump))
+  if (any_uncondjump_p (jump) && onlyjump_p (jump))
     {
       /* The condition is always true.  */
       delete_insn (jump);