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  <x...@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

Reply via email to