From 64880a7c49e2f60d1ccabf6798f5b0ea8234edc1 Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Sat, 5 Dec 2020 18:26:24 +0000 Subject: [PATCH] cfgrtl: Add missing call to `onlyjump_p' If any unconditional jumps within a block have side effects then the block cannot be considered empty. gcc/ * cfgrtl.c (rtl_block_empty_p): Return false if `!onlyjump_p' too. --- gcc/cfgrtl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 5e909e25882..4d024951313 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -4862,7 +4862,8 @@ rtl_block_empty_p (basic_block bb) return true; FOR_BB_INSNS (bb, insn) - if (NONDEBUG_INSN_P (insn) && !any_uncondjump_p (insn)) + if (NONDEBUG_INSN_P (insn) + && (!any_uncondjump_p (insn) || !onlyjump_p (insn))) return false; return true; -- 2.30.2