diff mbox

Allow references to symbols with user specified DEFAULT bisibility

Message ID 20140204060719.GB26386@kam.mff.cuni.cz
State New
Headers show

Commit Message

Jan Hubicka Feb. 4, 2014, 6:07 a.m. UTC
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.

Comments

Richard Biener Feb. 4, 2014, 9:12 a.m. UTC | #1
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.
> 
>
diff mbox

Patch

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.