https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83100

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I'll test:
--- gcc/varasm.c.jj     2017-11-21 20:23:02.000000000 +0100
+++ gcc/varasm.c        2017-11-24 21:43:55.616951823 +0100
@@ -986,9 +986,9 @@ decode_reg_name (const char *name)
 bool
 bss_initializer_p (const_tree decl)
 {
-  /* Do not put constants into the .bss section, they belong in a readonly
-     section.  */
-  return (!TREE_READONLY (decl)
+  /* Do not put non-common constants into the .bss section, they belong in
+     a readonly section.  */
+  return ((!TREE_READONLY (decl) || DECL_COMMON (decl))
          && (DECL_INITIAL (decl) == NULL
              /* In LTO we have no errors in program; error_mark_node is used
                 to mark offlined constructors.  */
after cooking up a testcase.

Reply via email to