Allow references to symbols with user specified DEFAULT bisibility
Jan Hubicka
hubicka@ucw.cz
Tue Feb 4 06:07:00 GMT 2014
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.
More information about the Gcc-patches
mailing list