decl2.c (setup_initp): Compare DECL_ASSEMBLER_NAME instead of the decls themselves.
authorJason Merrill <jason@yorick.cygnus.com>
Wed, 14 Apr 1999 00:00:20 +0000 (00:00 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 14 Apr 1999 00:00:20 +0000 (20:00 -0400)
* decl2.c (setup_initp): Compare DECL_ASSEMBLER_NAME instead
of the decls themselves.

From-SVN: r26435

gcc/cp/ChangeLog
gcc/cp/decl2.c

index 1f01cd3149f1cb84af7c3ed334f5dcf1a9a89bf0..b320d5d725aec2cff31efd128a5c8b326ed9e05a 100644 (file)
@@ -1,5 +1,8 @@
 1999-04-13  Jason Merrill  <jason@yorick.cygnus.com>
 
+       * decl2.c (setup_initp): Compare DECL_ASSEMBLER_NAME instead
+       of the decls themselves.
+
        * pt.c (tsubst_function_type): Copy attributes over.
 
        * tree.c (cp_valid_lang_attribute): New fn.  Handle init_priority
index 0ba19fdc8fa898d236520ab0cf5566555524dd3f..4ea3035099c9afe643a7fbef0d5e342950b2b65b 100644 (file)
@@ -2897,7 +2897,14 @@ setup_initp ()
   p = &static_aggregates;
   for (; *p; )
     {
-      t = value_member (TREE_VALUE (*p), static_aggregates_initp);
+      /* We check for symbol equivalence rather than identical decls
+        because decl_attributes is run before duplicate_decls.
+        XXX change to use DECL_MACHINE_ATTRIBUTES instead of
+        static_aggregates_initp.  */
+      for (t = static_aggregates_initp; t; t = TREE_CHAIN (t))
+       if (DECL_ASSEMBLER_NAME (TREE_VALUE (t))
+           == DECL_ASSEMBLER_NAME (TREE_VALUE (*p)))
+         break;
 
       if (t)
        {