From: Maciej W. Rozycki Date: Sat, 5 Dec 2020 18:26:24 +0000 (+0000) Subject: loop-iv: Add missing calls to `onlyjump_p' X-Git-Tag: upstream/12.2.0~11185 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a2bd4e52cf710924107b08daaf3d09d7798c8022;p=platform%2Fupstream%2Fgcc.git loop-iv: Add missing calls to `onlyjump_p' Ignore jumps that have side effects in loop processing as pasting the body of a loop multiple times within is semantically equivalent to jump deletion (between the iterations unrolled) even if we do not physically delete the jump RTL insn. gcc/ * loop-iv.c (simplify_using_initial_values): Only process jumps that match `onlyjump_p'. (check_simple_exit): Likewise. --- diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c index 9f266e2..9d401d2 100644 --- a/gcc/loop-iv.c +++ b/gcc/loop-iv.c @@ -1936,7 +1936,7 @@ simplify_using_initial_values (class loop *loop, enum rtx_code op, rtx *expr) while (1) { insn = BB_END (e->src); - if (any_condjump_p (insn)) + if (any_condjump_p (insn) && onlyjump_p (insn)) { rtx cond = get_condition (BB_END (e->src), NULL, false, true); @@ -2887,7 +2887,7 @@ check_simple_exit (class loop *loop, edge e, class niter_desc *desc) return; /* It must end in a simple conditional jump. */ - if (!any_condjump_p (BB_END (exit_bb))) + if (!any_condjump_p (BB_END (exit_bb)) || !onlyjump_p (BB_END (exit_bb))) return; ein = EDGE_SUCC (exit_bb, 0);