Fix handling of symbols in other partition in symtab_node::binds_to_current_def_p

Richard Biener richard.guenther@gmail.com
Thu Oct 15 12:40:42 GMT 2020


On Thu, Oct 15, 2020 at 2:37 PM Jan Hubicka <hubicka@ucw.cz> wrote:
>
> > On Thu, Oct 15, 2020 at 1:53 PM Jan Hubicka <hubicka@ucw.cz> wrote:
> > >
> > > Hi,
> > > this patch makes binds_to_current_def_p to return true when the current
> > > def is in other partition.  This is needed for modref to propagate info
> > > on loads across partition boundary.
> >
> > Hmm, but partitioning shouldn't influence what a def binds to so this looks
> > like a wrong (possibly pessimizing) change?
>
> If you have symbol in ohter partition you get
>   definition == false
>   in_other_partition == true
> So previously we returned false at the first check, now we proceed
> testing if the definition binds locally from the visibility and
> resolution info (eventually looking for LDPR_PREVAILING_DEF*)

Ah, I misread - so the patch fixes what I thought it introduces.

Nice.

Richard.

> Honza
> >
> > > Bootstrapped/regtsted x86_64-linux, comitted.
> > >
> > >         * symtab.c (symtab_node::binds_to_current_def_p): Also accept symbols
> > >         defined in other partition.
> > > diff --git a/gcc/symtab.c b/gcc/symtab.c
> > > index 207c9e75890..bc2865f4121 100644
> > > --- a/gcc/symtab.c
> > > +++ b/gcc/symtab.c
> > > @@ -2391,7 +2391,7 @@ symbol_table::symbol_suffix_separator ()
> > >  bool
> > >  symtab_node::binds_to_current_def_p (symtab_node *ref)
> > >  {
> > > -  if (!definition)
> > > +  if (!definition && !in_other_partition)
> > >      return false;
> > >    if (transparent_alias)
> > >      return definition


More information about the Gcc-patches mailing list