Re: Allow references to symbols with user specified DEFAULT bisibility
On Tue, 4 Feb 2014, Jan Hubicka wrote: > Hi, > while implementing checks in can_refer_decl_in_current_unit_p I had primarily > symbols > with HIDDEN visibility in mind. I just noticed that libstdc++ makes quite > few symbols > with default visbility specified by hand. I see no reason for disabling > optimization > here. > > Bootstrapped/regtested x86_64-linux, OK? Ok. Thanks, Richard. > * gimple-fold.c (can_refer_decl_in_current_unit_p): Allow references to > symbols with user specified default visibility. > > Index: gimple-fold.c > === > --- gimple-fold.c (revision 207450) > +++ gimple-fold.c (working copy) > @@ -114,6 +114,7 @@ can_refer_decl_in_current_unit_p (tree d > unit may be in separate DSO and the symbol may be hidden. */ >if (DECL_VISIBILITY_SPECIFIED (decl) >&& DECL_EXTERNAL (decl) > + && DECL_VISIBILITY (decl) != VISIBILITY_DEFAULT >&& (!(snode = symtab_get_node (decl)) || !snode->in_other_partition)) > return false; >/* When function is public, we always can introduce new reference. > >
Allow references to symbols with user specified DEFAULT bisibility
Hi, while implementing checks in can_refer_decl_in_current_unit_p I had primarily symbols with HIDDEN visibility in mind. I just noticed that libstdc++ makes quite few symbols with default visbility specified by hand. I see no reason for disabling optimization here. Bootstrapped/regtested x86_64-linux, OK? * gimple-fold.c (can_refer_decl_in_current_unit_p): Allow references to symbols with user specified default visibility. Index: gimple-fold.c === --- gimple-fold.c (revision 207450) +++ gimple-fold.c (working copy) @@ -114,6 +114,7 @@ can_refer_decl_in_current_unit_p (tree d unit may be in separate DSO and the symbol may be hidden. */ if (DECL_VISIBILITY_SPECIFIED (decl) && DECL_EXTERNAL (decl) + && DECL_VISIBILITY (decl) != VISIBILITY_DEFAULT && (!(snode = symtab_get_node (decl)) || !snode->in_other_partition)) return false; /* When function is public, we always can introduce new reference.