On Wed, 11 May 2022, Richard Biener wrote: > When the insn to delete is a debug insn there's no point in figuring > out whether it might be the last real insn and thus we have to purge > dead edges. > > Bootstrap and regtest running on x86_64-unknown-linux-gnu.
Actually revisiting PR94618 which introduced this the following is better and is what I'm going to test, making sure to never purge edges for DEBUG_INSNs. diff --git a/gcc/cfgrtl.cc b/gcc/cfgrtl.cc index 74ea14efc61..06be46d75df 100644 --- a/gcc/cfgrtl.cc +++ b/gcc/cfgrtl.cc @@ -235,7 +235,7 @@ delete_insn_and_edges (rtx_insn *insn) { bool purge = false; - if (INSN_P (insn) && BLOCK_FOR_INSN (insn)) + if (NONDEBUG_INSN_P (insn) && BLOCK_FOR_INSN (insn)) { basic_block bb = BLOCK_FOR_INSN (insn); if (BB_END (bb) == insn) > 2022-05-11 Richard Biener <rguent...@suse.de> > > PR rtl-optimization/105559 > * cfgrtl.cc (delete_insn_and_edges): Only perform search to BB_END > for non-debug insns. > --- > gcc/cfgrtl.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/cfgrtl.cc b/gcc/cfgrtl.cc > index 74ea14efc61..8e9fd1266b3 100644 > --- a/gcc/cfgrtl.cc > +++ b/gcc/cfgrtl.cc > @@ -240,7 +240,7 @@ delete_insn_and_edges (rtx_insn *insn) > basic_block bb = BLOCK_FOR_INSN (insn); > if (BB_END (bb) == insn) > purge = true; > - else if (DEBUG_INSN_P (BB_END (bb))) > + else if (NONDEBUG_INSN_P (insn) && DEBUG_INSN_P (BB_END (bb))) > for (rtx_insn *dinsn = NEXT_INSN (insn); > DEBUG_INSN_P (dinsn); dinsn = NEXT_INSN (dinsn)) > if (BB_END (bb) == dinsn) > -- Richard Biener <rguent...@suse.de> SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; GF: Ivo Totev; HRB 36809 (AG Nuernberg)