http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57366

--- Comment #9 from Jan Hubicka <hubicka at ucw dot cz> ---
Hi,
the following patch sets IDENTIFIER_TRANSPARENT_ALIAS correctly from lto-symtab
(correct fix should do the same for variable aliases, too).  Now the testcase
compiles for
me on Linux with weakref disabled.  Does it work for you?
I can not bootstrap with the weakref disabling hack because of some
transational memory issue, but I think it is independent.

Honza

Index: lto-symtab.c
===================================================================
--- lto-symtab.c    (revision 199251)
+++ lto-symtab.c    (working copy)
@@ -623,6 +623,15 @@ lto_symtab_merge_cgraph_nodes (void)
       if ((cnode->thunk.thunk_p || cnode->alias)
       && cnode->thunk.alias && DECL_P (cnode->thunk.alias))
         cnode->thunk.alias = lto_symtab_prevailing_decl (cnode->thunk.alias);
+#ifndef ASM_OUTPUT_WEAKREF
+      if (lookup_attribute ("weakref", DECL_ATTRIBUTES (cnode->symbol.decl)))
+    {
+      IDENTIFIER_TRANSPARENT_ALIAS (DECL_ASSEMBLER_NAME (cnode->symbol.decl))
= 1;
+      TREE_CHAIN (DECL_ASSEMBLER_NAME (cnode->symbol.decl))
+          = (DECL_P (cnode->thunk.alias) ? DECL_ASSEMBLER_NAME
(cnode->thunk.alias)
+             : cnode->thunk.alias);
+    }
+#endif
       cnode->symbol.aux = NULL;
     }
   FOR_EACH_VARIABLE (vnode)

Reply via email to