Possible regression in DF analysis

Richard Biener richard.guenther@gmail.com
Wed Dec 14 11:06:20 GMT 2022


On Wed, Dec 14, 2022 at 11:37 AM Claudiu Zissulescu Ianculescu
<claziss@gmail.com> wrote:
>
> I have update the fix to this one:
>
> diff --git a/gcc/df-core.cc b/gcc/df-core.cc
> index a901b84878f..cc6383990a1 100644
> --- a/gcc/df-core.cc
> +++ b/gcc/df-core.cc
> @@ -1437,7 +1437,16 @@ df_analyze_loop (class loop *loop)
>    df_set_blocks (blocks);
>    BITMAP_FREE (blocks);
>
> -  df_analyze_1 ();
> +  /* Iterate over loop's exit edges and add theirs destinations BB
> +     indexes.  */
> +  struct loop_exit *exit;
> +  for (exit = loop->exits->next; exit->e; exit = exit->next)
> +    bitmap_set_bit (df->blocks_to_analyze, exit->e->dest->index);

I think you want to adjust the local 'blocks' bitmap passed to df_set_blocks.
There's also the issue that the computed postorder doesn't include the new
blocks and thus the computation will likely be invalid?

> +
> +  if (dump_file)
> +    debug_bitmap_file (dump_file, df->blocks_to_analyze);
> +
> +  df_analyze ();
>  }
>
> I still need to validate it for x86
>
> Best,
> Claudiu
>
> On Tue, Dec 13, 2022 at 7:38 PM Claudiu Zissulescu Ianculescu
> <claziss@gmail.com> wrote:
> >
> > >
> > > Maybe you want to iterate over the loops exit edges and include their destination block instead?
> > >
> >
> > This is better approach, let me try it and I will be back to you.
> >
> > Thanks,
> > Claudiu


More information about the Gcc mailing list