Patchwork [google-4_6] disable localization of hidden symbols in streaming LIPO (issue6101045)

login
register
mail settings
Submitter Rong Xu
Date April 20, 2012, 9:13 p.m.
Message ID <20120420211319.69D86C1B73@rong.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/154165/
State New
Headers show

Comments

Rong Xu - April 20, 2012, 9:13 p.m.
Hi, 

This patch is for google-4_6 branch only.

It disables the localization of hidden and internal symbols in streaming
LIPO. Otherwise, we may have undefines in link time because of the reference in
other module that is not include the define module into module group.

Tested with google internal benchmarks, gcc regression and bootstrap.

Thanks,

-Rong

2012-04-20   Rong Xu  <xur@google.com>

	* gcc/ipa.c (cgraph_externally_visible_p): Not localize hidden symbols
        in streaming LIPO.
	(varpool_externally_visible_p): Ditto.


--
This patch is available for review at http://codereview.appspot.com/6101045
Xinliang David Li - April 20, 2012, 9:17 p.m.
ok.

thanks,

David

On Fri, Apr 20, 2012 at 2:13 PM, Rong Xu <xur@google.com> wrote:
> Hi,
>
> This patch is for google-4_6 branch only.
>
> It disables the localization of hidden and internal symbols in streaming
> LIPO. Otherwise, we may have undefines in link time because of the reference in
> other module that is not include the define module into module group.
>
> Tested with google internal benchmarks, gcc regression and bootstrap.
>
> Thanks,
>
> -Rong
>
> 2012-04-20   Rong Xu  <xur@google.com>
>
>        * gcc/ipa.c (cgraph_externally_visible_p): Not localize hidden symbols
>        in streaming LIPO.
>        (varpool_externally_visible_p): Ditto.
>
> Index: gcc/ipa.c
> ===================================================================
> --- gcc/ipa.c   (revision 186600)
> +++ gcc/ipa.c   (working copy)
> @@ -790,7 +790,9 @@ cgraph_externally_visible_p (struct cgraph_node *n
>     return false;
>
>   /* When doing link time optimizations, hidden symbols become local.  */
> -  if (in_lto_p
> +  /* Disable this in streaming LIPO, as the defition may not be seen by all
> +     the references.  */
> +  if (in_lto_p && !flag_ripa_stream
>       && (DECL_VISIBILITY (node->decl) == VISIBILITY_HIDDEN
>          || DECL_VISIBILITY (node->decl) == VISIBILITY_INTERNAL)
>       /* Be sure that node is defined in IR file, not in other object
> @@ -885,7 +887,9 @@ varpool_externally_visible_p (struct varpool_node
>     return false;
>
>   /* When doing link time optimizations, hidden symbols become local.  */
> -  if (in_lto_p
> +  /* Disable this in streaming LIPO, as the defition may not be seen by all
> +     the references.  */
> +  if (in_lto_p && !flag_ripa_stream
>       && (DECL_VISIBILITY (vnode->decl) == VISIBILITY_HIDDEN
>          || DECL_VISIBILITY (vnode->decl) == VISIBILITY_INTERNAL)
>       /* Be sure that node is defined in IR file, not in other object
>
> --
> This patch is available for review at http://codereview.appspot.com/6101045

Patch

Index: gcc/ipa.c
===================================================================
--- gcc/ipa.c	(revision 186600)
+++ gcc/ipa.c	(working copy)
@@ -790,7 +790,9 @@  cgraph_externally_visible_p (struct cgraph_node *n
     return false;
 
   /* When doing link time optimizations, hidden symbols become local.  */
-  if (in_lto_p
+  /* Disable this in streaming LIPO, as the defition may not be seen by all
+     the references.  */
+  if (in_lto_p && !flag_ripa_stream
       && (DECL_VISIBILITY (node->decl) == VISIBILITY_HIDDEN
 	  || DECL_VISIBILITY (node->decl) == VISIBILITY_INTERNAL)
       /* Be sure that node is defined in IR file, not in other object
@@ -885,7 +887,9 @@  varpool_externally_visible_p (struct varpool_node
     return false;
 
   /* When doing link time optimizations, hidden symbols become local.  */
-  if (in_lto_p
+  /* Disable this in streaming LIPO, as the defition may not be seen by all
+     the references.  */
+  if (in_lto_p && !flag_ripa_stream
       && (DECL_VISIBILITY (vnode->decl) == VISIBILITY_HIDDEN
 	  || DECL_VISIBILITY (vnode->decl) == VISIBILITY_INTERNAL)
       /* Be sure that node is defined in IR file, not in other object