Hi,
while hacking firefox to work around ABI compatibility issues with LLVM
I ran into an ICE where comdat group was resolved externaly but contains
a static alias (for thunk). In this case parittioner attempts to put
that static definition into a partition which triggers an ICE.

Bootstrapped/regtested x86_64-linux, comitted.

        * symtab.c (symtab_node::get_partitioning_class): Aliases of external
        symbols are external.
Index: symtab.c
===================================================================
--- symtab.c    (revision 279178)
+++ symtab.c    (working copy)
@@ -1952,6 +1952,11 @@ symtab_node::get_partitioning_class (voi
   if (DECL_EXTERNAL (decl))
     return SYMBOL_EXTERNAL;
 
+  /* Even static aliases of external functions as external.  Those can happen
+     when COMDAT got resolved to non-IL implementation.  */
+  if (alias && DECL_EXTERNAL (ultimate_alias_target ()->decl))
+    return SYMBOL_EXTERNAL;
+
   if (varpool_node *vnode = dyn_cast <varpool_node *> (this))
     {
       if (alias && definition && !ultimate_alias_target ()->definition)

Reply via email to