On Wed, May 11, 2022 at 01:45:13PM +0200, Richard Biener via Gcc-patches wrote:
> 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)

Yeah, wanted to suggest the same.  Because
purge_dead_edges actually doesn't punt on DEBUG_INSNs, but instead
it looks for the last non-debug insn in the same bb before it if any.

        Jakub

Reply via email to