summaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index a055bbf0010..8a7f949245c 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -922,6 +922,10 @@ make_decl_rtl (decl, asmspec)
&& DECL_COMMON (decl))
DECL_COMMON (decl) = 0;
+ /* Variables can't be both common and weak. */
+ if (TREE_CODE (decl) == VAR_DECL && DECL_WEAK (decl))
+ DECL_COMMON (decl) = 0;
+
/* Can't use just the variable's own name for a variable
whose scope is less than the whole file, unless it's a member
of a local class (which will already be unambiguous).