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

            Bug ID: 113974
           Summary: Attribute common ignored
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---

__attribute__((common,used))
static int cc;

when this code is compiled with -S -fdata-sections then cc is not put into
.lcomm (and is not .local .comm either):

        .section        .bss.cc,"aw",@nobits
        .align 4
        .type   cc, @object
        .size   cc, 4
cc:
        .zero   4
        .ident  "GCC: (GNU) 13.2.1 20231022"

with -fno-data-sections, though, it works as expected:

        .local  cc
        .comm   cc,4,4

Reply via email to