diff mbox series

[4/6] cfgrtl: Add missing call to `onlyjump_p'

Message ID alpine.LFD.2.21.2012031055400.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:34 a.m. UTC
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(-)

gcc-cfgrtl-block-empty-only-jump.diff

Comments

Jeff Law Dec. 3, 2020, 10:03 p.m. UTC | #1
On 12/3/20 4:34 AM, Maciej W. Rozycki wrote:
> 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.
OK
jeff
diff mbox series

Patch

Index: gcc/gcc/cfgrtl.c
===================================================================
--- gcc.orig/gcc/cfgrtl.c
+++ gcc/gcc/cfgrtl.c
@@ -4860,7 +4860,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;