re PR lto/53572 (Some public symbols don't get to serialized LTO)
authorJan Hubicka <jh@suse.cz>
Tue, 26 Jun 2012 10:15:18 +0000 (12:15 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 26 Jun 2012 10:15:18 +0000 (10:15 +0000)
PR lto/53572
* cgraph.h (varpool_can_remove_if_no_refs): Fix handling of
used symbols.

From-SVN: r188982

gcc/ChangeLog
gcc/cgraph.h

index 2fd5563..3d93cec 100644 (file)
@@ -1,3 +1,9 @@
+2012-06-26  Jan Hubicka  <jh@suse.cz>
+
+       PR lto/53572
+       * cgraph.h (varpool_can_remove_if_no_refs): Fix handling of
+       used symbols.
+
 2012-06-26  Dehao Chen  <dehao@google.com>
 
        * tree-inline.c: (expand_call_inline): Ensure that lexical block's
index 0dec33f..7b9098b 100644 (file)
@@ -1126,7 +1126,8 @@ varpool_can_remove_if_no_refs (struct varpool_node *node)
   if (DECL_EXTERNAL (node->symbol.decl))
     return true;
   return (!node->symbol.force_output && !node->symbol.used_from_other_partition
-         && (DECL_COMDAT (node->symbol.decl)
+         && ((DECL_COMDAT (node->symbol.decl)
+              && !symtab_used_from_object_file_p ((symtab_node) node))
              || !node->symbol.externally_visible
              || DECL_HAS_VALUE_EXPR_P (node->symbol.decl)));
 }