Hi,
my reorg of wekarefs broke solaris bootstrap. The problem is that C++ FE 
produces
aliases for external variables/functions and expect them to be always thrown 
away.
I think this was originally an oversight, since they are completely useless for
rest of compilation but with new alias representation we ought to be able to use
them to prove that the two vars are known to be equivalent. This patch however 
just
prevents cgraphunit from outputting them and thus fixes the bootstrap issue.

Bootstrapped/regtested & comitted.
Honza
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 181310)
+++ ChangeLog   (working copy)
@@ -1,3 +1,8 @@
+2011-11-12  Jan Hubicka  <j...@suse.cz>
+
+       PR bootstrap/50822
+       * cgraphunit.c (output_weakrefs): Output really only weakrefs.
+
 2011-11-12  Nathan Sidwell  <nat...@acm.org>
 
        * gcov.c (struct name_map): New.
Index: cgraphunit.c
===================================================================
--- cgraphunit.c        (revision 181310)
+++ cgraphunit.c        (working copy)
@@ -2101,13 +2101,15 @@ output_weakrefs (void)
   struct varpool_node *vnode;
   for (node = cgraph_nodes; node; node = node->next)
     if (node->alias && DECL_EXTERNAL (node->decl)
-        && !TREE_ASM_WRITTEN (node->decl))
+        && !TREE_ASM_WRITTEN (node->decl)
+       && lookup_attribute ("weakref", DECL_ATTRIBUTES (node->decl)))
       assemble_alias (node->decl,
                      node->thunk.alias ? DECL_ASSEMBLER_NAME 
(node->thunk.alias)
                      : get_alias_symbol (node->decl));
   for (vnode = varpool_nodes; vnode; vnode = vnode->next)
     if (vnode->alias && DECL_EXTERNAL (vnode->decl)
-        && !TREE_ASM_WRITTEN (vnode->decl))
+        && !TREE_ASM_WRITTEN (vnode->decl)
+       && lookup_attribute ("weakref", DECL_ATTRIBUTES (vnode->decl)))
       assemble_alias (vnode->decl,
                      vnode->alias_of ? DECL_ASSEMBLER_NAME (vnode->alias_of)
                      : get_alias_symbol (vnode->decl));

Reply via email to