]> gcc.gnu.org Git - gcc.git/commitdiff
(duplicate_decls): Merge DECL_IN_SYSTEM_HEADER between duplicate decls.
authorRichard Stallman <rms@gnu.org>
Tue, 7 Jul 1992 01:47:54 +0000 (01:47 +0000)
committerRichard Stallman <rms@gnu.org>
Tue, 7 Jul 1992 01:47:54 +0000 (01:47 +0000)
From-SVN: r1492

gcc/c-decl.c

index 4f00471628079516eea7eda931edbf0dab33e3fb..34c4e1050e4dfb0ff013ee1b22ba0b63d290826c 100644 (file)
@@ -1449,7 +1449,11 @@ duplicate_decls (newdecl, olddecl)
       if (TREE_READONLY (newdecl))
        TREE_READONLY (olddecl) = 1;
       if (TREE_THIS_VOLATILE (newdecl))
-       TREE_THIS_VOLATILE (olddecl) = 1;
+       {
+         TREE_THIS_VOLATILE (olddecl) = 1;
+         if (TREE_CODE (newdecl) == VAR_DECL)
+           make_var_volatile (newdecl);
+       }
 
       /* Keep source location of definition rather than declaration.  */
       if (DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0)
@@ -1458,14 +1462,18 @@ duplicate_decls (newdecl, olddecl)
          DECL_SOURCE_FILE (newdecl) = DECL_SOURCE_FILE (olddecl);
        }
 
+      /* Merge the unused-warning information.  */
+      if (DECL_IN_SYSTEM_HEADER (olddecl))
+       DECL_IN_SYSTEM_HEADER (newdecl) = 1;
+      else if (DECL_IN_SYSTEM_HEADER (newdecl))
+       DECL_IN_SYSTEM_HEADER (olddecl) = 1;
+
       /* Merge the initialization information.  */
       if (DECL_INITIAL (newdecl) == 0)
        DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
+
       /* Keep the old rtl since we can safely use it.  */
       DECL_RTL (newdecl) = DECL_RTL (olddecl);
-      if (TREE_CODE (newdecl) == VAR_DECL
-         && TREE_THIS_VOLATILE (newdecl))
-       make_var_volatile (newdecl);
     }
   /* If cannot merge, then use the new type and qualifiers,
      and don't preserve the old rtl.  */
This page took 0.074245 seconds and 5 git commands to generate.