(duplicate_decls): Merge section name into new decl.
authorDoug Evans <dje@gnu.org>
Thu, 17 Feb 1994 22:49:29 +0000 (22:49 +0000)
committerDoug Evans <dje@gnu.org>
Thu, 17 Feb 1994 22:49:29 +0000 (22:49 +0000)
From-SVN: r6583

gcc/c-decl.c

index dbb1f624b13c8ffe97d92cfcc9f2b7dd12176f80..d0bbad1a500b7724a8b64dc7e075f561181ec5a9 100644 (file)
@@ -1671,6 +1671,13 @@ duplicate_decls (newdecl, olddecl)
       /* Merge the initialization information.  */
       if (DECL_INITIAL (newdecl) == 0)
        DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
+
+      /* Merge the section attribute.
+         We want to issue an error if the sections conflict but that must be
+        done later in decl_attributes since we are called before attributes
+        are assigned.  */
+      if (DECL_SECTION_NAME (newdecl) == NULL_TREE)
+       DECL_SECTION_NAME (newdecl) = DECL_SECTION_NAME (olddecl);
     }
   /* If cannot merge, then use the new type and qualifiers,
      and don't preserve the old rtl.  */