aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index bdb6819..7929aa8 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1862,6 +1862,12 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
extern_changed = DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl);
+ /* Merge the USED information. */
+ if (TREE_USED (olddecl))
+ TREE_USED (newdecl) = 1;
+ else if (TREE_USED (newdecl))
+ TREE_USED (olddecl) = 1;
+
/* Copy most of the decl-specific fields of NEWDECL into OLDDECL.
But preserve OLDDECL's DECL_UID and DECL_CONTEXT. */
{