Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
- index 4f6761d..810ae4c 100644
- --- a/gcc/c/c-decl.c
- +++ b/gcc/c/c-decl.c
- @@ -2631,6 +2631,18 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
- else if (DECL_PRESERVE_P (newdecl))
- DECL_PRESERVE_P (olddecl) = 1;
- + int decl_common = 0;
- + /* check for 'common' attribute (PR49551) */
- + if (TREE_CODE (olddecl) == VAR_DECL
- + && TREE_CODE (newdecl) == VAR_DECL)
- + {
- + if (lookup_attribute ("common", DECL_ATTRIBUTES (newdecl))
- + || lookup_attribute ("nocommon", DECL_ATTRIBUTES (newdecl)))
- + decl_common = DECL_COMMON (newdecl);
- + else
- + decl_common = DECL_COMMON (olddecl) && DECL_COMMON (newdecl);
- + }
- +
- /* Copy most of the decl-specific fields of NEWDECL into OLDDECL.
- But preserve OLDDECL's DECL_UID, DECL_CONTEXT and
- DECL_ARGUMENTS (if appropriate). */
- @@ -2694,6 +2706,8 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
- DECL_CONTEXT (olddecl) = olddecl_context;
- if (TREE_CODE (olddecl) == FUNCTION_DECL)
- DECL_ARGUMENTS (olddecl) = olddecl_arguments;
- + if (TREE_CODE (olddecl) == VAR_DECL)
- + DECL_COMMON (olddecl) = decl_common;
- }
- /* If OLDDECL had its DECL_RTL instantiated, re-invoke make_decl_rtl
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement