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

            Bug ID: 121081
           Summary: ICE on x86_64-linux-gnu: in composite_type, at
                    c/c-typeck.cc:1011 with visibility attribute on atomic
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jiangchangwu at smail dot nju.edu.cn
  Target Milestone: ---

Compiler Explorer: https://gcc.godbolt.org/z/G1xooYr5v

*******************************************************************************
gcc version:
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/16.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++ --prefix=/home/software/gcc-trunk --enable-coverage
--disable-werror --enable-checking=yes
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 16.0.0 20250613 (experimental) (GCC)

*******************************************************************************
Program:
$ cat mutant.c
int *_Atomic __attribute__((visibility(""))) a;
_Atomic(int *) a __attribute__(());

*******************************************************************************
Command Lines:
$ gcc mutant.c
mutant.c:1:1: warning: 'visibility' attribute ignored on non-class types
[-Wattributes]
    1 | int *_Atomic __attribute__((visibility(""))) a;
      | ^~~
mutant.c:2:1: internal compiler error: in composite_type, at c/c-typeck.cc:1011
    2 | _Atomic(int *) a __attribute__(());
      | ^~~~~~~
0x5554b38 internal_error(char const*, ...)
        ../../gcc/gcc/diagnostic-global-context.cc:517
0x54d2d0a fancy_abort(char const*, int, char const*)
        ../../gcc/gcc/diagnostic.cc:1803
0xf55b93 composite_type(tree_node*, tree_node*)
        ../../gcc/gcc/c/c-typeck.cc:1011
0xee0751 merge_decls
        ../../gcc/gcc/c/c-decl.cc:2800
0xee4bf2 duplicate_decls
        ../../gcc/gcc/c/c-decl.cc:3187
0xee5e48 pushdecl(tree_node*)
        ../../gcc/gcc/c/c-decl.cc:3376
0xef1a66 start_decl(c_declarator*, c_declspecs*, bool, tree_node*, bool,
unsigned long*)
        ../../gcc/gcc/c/c-decl.cc:5755
0xff9933 c_parser_declaration_or_fndef
        ../../gcc/gcc/c/c-parser.cc:2957
0xff59fd c_parser_external_declaration
        ../../gcc/gcc/c/c-parser.cc:2155
0xff4ea2 c_parser_translation_unit
        ../../gcc/gcc/c/c-parser.cc:2009
0x10a17ee c_parse_file()
        ../../gcc/gcc/c/c-parser.cc:30153
0x11d7aeb c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.cc:1385
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Reply via email to