From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1256) id 0697E383303A; Sat, 5 Dec 2020 18:28:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0697E383303A MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Maciej W. Rozycki To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-5769] loop-iv: Add missing calls to `onlyjump_p' X-Act-Checkin: gcc X-Git-Author: Maciej W. Rozycki X-Git-Refname: refs/heads/master X-Git-Oldrev: 94f336768e199bc268c30446a63b49a53b02f648 X-Git-Newrev: a2bd4e52cf710924107b08daaf3d09d7798c8022 Message-Id: <20201205182803.0697E383303A@sourceware.org> Date: Sat, 5 Dec 2020 18:28:03 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2020 18:28:03 -0000 https://gcc.gnu.org/g:a2bd4e52cf710924107b08daaf3d09d7798c8022 commit r11-5769-ga2bd4e52cf710924107b08daaf3d09d7798c8022 Author: Maciej W. Rozycki Date: Sat Dec 5 18:26:24 2020 +0000 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: --- gcc/loop-iv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c index 9f266e2a43c..9d401d29b95 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);