On Fri, Nov 15, 2019 at 9:10 AM Jan Hubicka <hubi...@ucw.cz> wrote:
>
> > next is initialized only in the loop before, it is never updated
> > in it's own loop.
> >
> > gcc/ChangeLog
> >
> >       2019-11-15  Xiong Hu Luo  <luo...@linux.ibm.com>
> >
> >       * ipa-inline.c (inline_small_functions): Update iterator of next.
>
> OK,
> thanks!

This breaks bootstrap and the loop before is similarly odd.

(gdb) p edge
$1 = (cgraph_edge *) 0xa5a5a5a5a5a5a5a5

so apparently edge->next_callee is GCed (thus 'edge' itself is freed?)

Richard.

> Honza
> > ---
> >  gcc/ipa-inline.c | 15 +++++++++------
> >  1 file changed, 9 insertions(+), 6 deletions(-)
> >
> > diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
> > index 78ec0ec685f..96aefaf514b 100644
> > --- a/gcc/ipa-inline.c
> > +++ b/gcc/ipa-inline.c
> > @@ -1945,12 +1945,15 @@ inline_small_functions (void)
> >       }
> >        if (has_speculative)
> >       for (edge = node->callees; edge; edge = next)
> > -       if (edge->speculative && !speculation_useful_p (edge,
> > -                                                       edge->aux != NULL))
> > -         {
> > -           edge->resolve_speculation ();
> > -           update = true;
> > -         }
> > +       {
> > +         if (edge->speculative
> > +             && !speculation_useful_p (edge, edge->aux != NULL))
> > +           {
> > +             edge->resolve_speculation ();
> > +             update = true;
> > +           }
> > +         next = edge->next_callee;
> > +       }
> >        if (update)
> >       {
> >         struct cgraph_node *where = node->inlined_to
> > --
> > 2.21.0.777.g83232e3864
> >

Reply via email to