summaryrefslogtreecommitdiffstats
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/varasm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 818628ba273..865de4813e8 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -538,7 +538,9 @@ make_decl_rtl (decl, asmspec, top_level)
unit that behaved thusly). So warn the user. */
else if (TREE_CODE (decl) == VAR_DECL
&& DECL_SECTION_NAME (decl) != NULL_TREE
- && DECL_INITIAL (decl) == NULL_TREE)
+ && DECL_INITIAL (decl) == NULL_TREE
+ && DECL_COMMON (decl)
+ && ! flag_no_common)
{
warning_with_decl (decl,
"section attribute ignored for uninitialized variable `%s'");
OpenPOWER on IntegriCloud