From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1256) id 21AEA383303A; Sat, 5 Dec 2020 18:28:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21AEA383303A 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-5770] sel-sched-ir: Add missing call to `onlyjump_p' X-Act-Checkin: gcc X-Git-Author: Maciej W. Rozycki X-Git-Refname: refs/heads/master X-Git-Oldrev: a2bd4e52cf710924107b08daaf3d09d7798c8022 X-Git-Newrev: 4ec78ef4837eab9b7ce3f20d7f7b39c8a2f1e41c Message-Id: <20201205182808.21AEA383303A@sourceware.org> Date: Sat, 5 Dec 2020 18:28:08 +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:08 -0000 https://gcc.gnu.org/g:4ec78ef4837eab9b7ce3f20d7f7b39c8a2f1e41c commit r11-5770-g4ec78ef4837eab9b7ce3f20d7f7b39c8a2f1e41c Author: Maciej W. Rozycki Date: Sat Dec 5 18:26:24 2020 +0000 sel-sched-ir: Add missing call to `onlyjump_p' 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'. Diff: --- gcc/sel-sched-ir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index c8e086e4950..2bcd398391b 100644 --- a/gcc/sel-sched-ir.c +++ b/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))