This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix up decl_binds_to_current_def_p (PR target/56564)


> On Tue, Jun 11, 2013 at 08:39:07PM +0200, Jan Hubicka wrote:
> > > @@ -6802,10 +6802,20 @@ decl_binds_to_current_def_p (tree decl)
> > >  	return resolution_to_local_definition_p (node->symbol.resolution);
> > >      }
> > >    /* Otherwise we have to assume the worst for DECL_WEAK (hidden weaks
> > > -     binds locally but still can be overwritten).
> > > +     binds locally but still can be overwritten), DECL_COMMON (can be merged
> > > +     with a non-common definition somewhere in the same module) or
> > > +     DECL_EXTERNAL.
> > >       This rely on fact that binds_local_p behave as decl_replaceable_p
> > >       for all other declaration types.  */
> > > -  return !DECL_WEAK (decl);
> > > +  if (DECL_WEAK (decl))
> > > +    return false;
> > > +  if (DECL_COMMON (decl)
> > > +      && (DECL_INITIAL (decl) == NULL
> > > +	  || DECL_INITIAL (decl) == error_mark_node))
> > > +    return false;
> > 
> > As discussed on IRC, this will return unnecesarily conservative answer for
> > HIDDEN visibility and (resolution == LDPR_PREVAILING_DEF_IRONLY or resolution == LDPR_PREVAILING_DEF) symbols.
> 
> If resolution is not LDPR_UNKNOWN, then we don't enter this code at all.
> In that case we simply check binds_local_p (it returns true for those),
> !TREE_PUBLIC (false), and then just look at at the resolution (so
> preexisting code).

Ah, sorry, you are right.  I overlooked that you kept the existing resolution
code around.

Except for the independent problem with default visibility on external symbols
in default_binds_local_p_1 I do not see any other issue.  I will send separate
patch for that tomorrow.

Thanks,
Honza
> 
> 	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]