https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85583

--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Problem is that we do not account correctly duplicated symbols because we do
not
add them into boundary
Index: lto/lto-partition.c
===================================================================
--- lto/lto-partition.c (revision 260258)
+++ lto/lto-partition.c (working copy)
@@ -439,13 +439,24 @@
 {
   if (cgraph_node *cnode = dyn_cast <cgraph_node *> (n1))
     n1 = cnode;
+  /* Do not account references from aliases - they are never split across
+     partitions.  */
+  if (n1->alias)
+    return false;
   /* Do not account recursion - the code below will handle it incorrectly
-     otherwise.  Also do not account references to external symbols.
-     They will never become local.  */
+     otherwise.  Do not account references to external symbols: they will
+     never become local.  Finally do not account references to duplicated
+     symbols: they will be always local.  */
   if (n1 == n2 
-      || DECL_EXTERNAL (n2->decl)
-      || !n2->definition)
+      || !n2->definition
+      || n2->get_partitioning_class () != SYMBOL_PARTITION)
     return false;
+  /* If referring node is duplicated symbol, we can not compute the boundary
+     cost, because we do not know what partition will be added to until
+     the boundary is computed.  */
+  if (contained_in_symbol (n1)
+       ->get_partitioning_class () != SYMBOL_PARTITION)
+    return false;
   return true;
 }

Reply via email to