This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix up decl_binds_to_current_def_p (PR target/56564)
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Richard Henderson <rth at redhat dot com>, Jan Hubicka <jh at suse dot cz>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 11 Jun 2013 20:57:04 +0200
- Subject: Re: [PATCH] Fix up decl_binds_to_current_def_p (PR target/56564)
- References: <20130611113151 dot GY1493 at tucnak dot redhat dot com> <51B756BC dot 4000202 at redhat dot com> <20130611170313 dot GH2336 at tucnak dot redhat dot com> <51B75BD9 dot 4030908 at redhat dot com> <20130611182048 dot GI2336 at tucnak dot redhat dot com> <20130611183907 dot GA2605 at atrey dot karlin dot mff dot cuni dot cz> <20130611184444 dot GJ2336 at tucnak dot redhat dot com>
> 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