https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113438
Bug ID: 113438 Summary: ICE (segfault) in dwarf2out_decl with -g -std=c23 on c23-tag-composite-2.c Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: acoplan at gcc dot gnu.org Target Milestone: --- I did a testsuite run with -g on aarch64 and noticed the following ICE: $ gcc/xgcc -B gcc -c ~/toolchain/src/gcc/gcc/testsuite/gcc.dg/c23-tag-composite-2.c -g -std=c23 /home/alecop01/toolchain/src/gcc/gcc/testsuite/gcc.dg/c23-tag-composite-2.c:15:21: internal compiler error: Segmentation fault 15 | void g(const struct foo { int x; } a); | ^~~ 0xf15783 crash_signal /home/alecop01/toolchain/src/other_gcc/gcc/toplev.cc:317 0xa23f04 dwarf2out_decl /home/alecop01/toolchain/src/other_gcc/gcc/dwarf2out.cc:27611 0xa242c3 dwarf2out_type_decl /home/alecop01/toolchain/src/other_gcc/gcc/dwarf2out.cc:27405 0xa242c3 dwarf2out_type_decl /home/alecop01/toolchain/src/other_gcc/gcc/dwarf2out.cc:27400 0xde0d8b rest_of_type_compilation(tree_node*, int) /home/alecop01/toolchain/src/other_gcc/gcc/passes.cc:339 0x79ce17 finish_struct(unsigned int, tree_node*, tree_node*, tree_node*, c_struct_parse_info*, tree_node**) /home/alecop01/toolchain/src/other_gcc/gcc/c/c-decl.cc:9733 0x7b29a7 composite_type_internal(tree_node*, tree_node*, composite_cache*) /home/alecop01/toolchain/src/other_gcc/gcc/c/c-typeck.cc:588 0x7b1867 composite_type_internal(tree_node*, tree_node*, composite_cache*) /home/alecop01/toolchain/src/other_gcc/gcc/c/c-typeck.cc:408 0x7b1867 composite_type_internal(tree_node*, tree_node*, composite_cache*) /home/alecop01/toolchain/src/other_gcc/gcc/c/c-typeck.cc:730 0x7b376f composite_type_internal(tree_node*, tree_node*, composite_cache*) /home/alecop01/toolchain/src/other_gcc/gcc/c/c-typeck.cc:408 0x7b376f composite_type(tree_node*, tree_node*) /home/alecop01/toolchain/src/other_gcc/gcc/c/c-typeck.cc:748 0x77c613 merge_decls /home/alecop01/toolchain/src/other_gcc/gcc/c/c-decl.cc:2798 0x77c613 duplicate_decls /home/alecop01/toolchain/src/other_gcc/gcc/c/c-decl.cc:3185 0x780347 pushdecl(tree_node*) /home/alecop01/toolchain/src/other_gcc/gcc/c/c-decl.cc:3374 0x798ba7 start_decl(c_declarator*, c_declspecs*, bool, tree_node*, bool, unsigned int*) /home/alecop01/toolchain/src/other_gcc/gcc/c/c-decl.cc:5703 0x81bce3 c_parser_declaration_or_fndef /home/alecop01/toolchain/src/other_gcc/gcc/c/c-parser.cc:2766 0x82962f c_parser_external_declaration /home/alecop01/toolchain/src/other_gcc/gcc/c/c-parser.cc:2046 0x82a16f c_parser_translation_unit /home/alecop01/toolchain/src/other_gcc/gcc/c/c-parser.cc:1900 0x82a16f c_parse_file() /home/alecop01/toolchain/src/other_gcc/gcc/c/c-parser.cc:26815 0x8aa8df c_common_parse_file() /home/alecop01/toolchain/src/other_gcc/gcc/c-family/c-opts.cc:1301 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.