This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Allow references to symbols with user specified DEFAULT bisibility
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org, rguenther at suse dot de
- Date: Tue, 4 Feb 2014 07:07:19 +0100
- Subject: Allow references to symbols with user specified DEFAULT bisibility
- Authentication-results: sourceware.org; auth=none
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.