]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lto-symtab.c (lto_symtab_resolve_can_prevail_p): Chose var with varpool.
authorJan Hubicka <jh@suse.cz>
Fri, 30 Apr 2010 18:45:47 +0000 (20:45 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 30 Apr 2010 18:45:47 +0000 (18:45 +0000)
* lto-symtab.c (lto_symtab_resolve_can_prevail_p): Chose var with varpool.
(lto_symtab_merge_decls_1): Remove logic looking for an initializer.

From-SVN: r158944

gcc/ChangeLog
gcc/lto-symtab.c

index 5a7de8f10f1cb375fb87a3d3479a641deb8aed39..e370a9f658c7ef4ab5e1077b80a43ffb0046c393 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-30  Jan Hubicka  <jh@suse.cz>
+
+       * lto-symtab.c (lto_symtab_resolve_can_prevail_p): Chose var with varpool.
+       (lto_symtab_merge_decls_1): Remove logic looking for an initializer.
+
 2010-04-30  Jan Hubicka  <jh@suse.cz>
 
        * cgraph.h (cgraph_node_set_nonempty_p, varpool_node_set_nonempty_p): New.
index a35d82fe3d42ee981f9d0f169d873fc14e11e2e0..b5430a5ab74fd59de436d88530956a329d870923 100644 (file)
@@ -406,11 +406,7 @@ lto_symtab_resolve_can_prevail_p (lto_symtab_entry_t e)
 
   /* A variable should have a size.  */
   else if (TREE_CODE (e->decl) == VAR_DECL)
-    return (DECL_SIZE (e->decl) != NULL_TREE
-           /* The C++ frontend retains TREE_STATIC on the declaration
-              of foo_ in struct Foo { static Foo *foo_; }; but it is
-              not a definition.  g++.dg/lto/20090315_0.C.  */
-           && !DECL_EXTERNAL (e->decl));
+    return (e->vnode && e->vnode->finalized);
 
   gcc_unreachable ();
 }
@@ -588,17 +584,6 @@ lto_symtab_merge_decls_1 (void **slot, void *data ATTRIBUTE_UNUSED)
        while (!prevailing->vnode
               && prevailing->next)
          prevailing = prevailing->next;
-      /* We do not stream varpool nodes, so the first decl has to
-        be good enough for now.
-        ???  For QOI choose a variable with readonly initializer
-        if there is one.  This matches C++
-        struct Foo { static const int i = 1; }; without a real
-        definition.  */
-      if (TREE_CODE (prevailing->decl) == VAR_DECL)
-       while (!(TREE_READONLY (prevailing->decl)
-                && DECL_INITIAL (prevailing->decl))
-              && prevailing->next)
-         prevailing = prevailing->next;
     }
 
   /* Move it first in the list.  */