Hi, 

This patch is for google branches only.
It fixes the unsatified symbol in lipo-use build.
Tested with SPEC and google internal benchmarks.

Thanks,

-Rong


2012-09-24  Rong Xu  <x...@google.com>
        
        * gcc/l-ipo.c (cgraph_is_aux_decl_external): output comdat
virtual functions when they are auxiliary modules; otherwise we may
get undefined symbol in linking.
        Google ref b/7078882.


Index: gcc/l-ipo.c
===================================================================
--- gcc/l-ipo.c (revision 191679)
+++ gcc/l-ipo.c (working copy)
@@ -1111,16 +1111,16 @@
   if (node->is_versioned_clone)
     return false;
 
-  /* virtual functions won't be deleted in the primary module.  */
-  if (DECL_VIRTUAL_P (decl))
-    return true;
-
   /* Comdat or weak functions in aux modules are not external --
      there is no guarantee that the definitition will be emitted
      in the primary compilation of this auxiliary module.  */
   if (DECL_COMDAT (decl) || DECL_WEAK (decl))
     return false;
 
+  /* virtual functions won't be deleted in the primary module.  */
+  if (DECL_VIRTUAL_P (decl))
+    return true;
+
   if (!TREE_PUBLIC (decl))
     return false;
 

--
This patch is available for review at http://codereview.appspot.com/6562044

Reply via email to