Commit e2f6a3cf by Richard Stallman

(duplicate_decls): Merge DECL_IN_SYSTEM_HEADER between duplicate decls.

From-SVN: r1492
parent 176e81eb
...@@ -1449,7 +1449,11 @@ duplicate_decls (newdecl, olddecl) ...@@ -1449,7 +1449,11 @@ duplicate_decls (newdecl, olddecl)
if (TREE_READONLY (newdecl)) if (TREE_READONLY (newdecl))
TREE_READONLY (olddecl) = 1; TREE_READONLY (olddecl) = 1;
if (TREE_THIS_VOLATILE (newdecl)) 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. */ /* Keep source location of definition rather than declaration. */
if (DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0) if (DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0)
...@@ -1458,14 +1462,18 @@ duplicate_decls (newdecl, olddecl) ...@@ -1458,14 +1462,18 @@ duplicate_decls (newdecl, olddecl)
DECL_SOURCE_FILE (newdecl) = DECL_SOURCE_FILE (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. */ /* Merge the initialization information. */
if (DECL_INITIAL (newdecl) == 0) if (DECL_INITIAL (newdecl) == 0)
DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl); DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
/* Keep the old rtl since we can safely use it. */ /* Keep the old rtl since we can safely use it. */
DECL_RTL (newdecl) = DECL_RTL (olddecl); 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, /* If cannot merge, then use the new type and qualifiers,
and don't preserve the old rtl. */ and don't preserve the old rtl. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment