Hi Richard,

Sorry for my misunderstanding. I am calling the df_analyze() instead
of df_analyze1() at the end. Shouldn't df_analyze take care and
compute the correct postorder  (df-core.cc:1273) ?

Thank you,
Claudiu

On Wed, Dec 14, 2022 at 1:06 PM Richard Biener
<richard.guent...@gmail.com> wrote:
>
> On Wed, Dec 14, 2022 at 11:37 AM Claudiu Zissulescu Ianculescu
> <claz...@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
> > <claz...@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

Reply via email to