https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113492
Bug ID: 113492 Summary: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Target Milestone: --- Host: x86_64-pc-linux-gnu Target: x86_64-pc-linux-gnu Created attachment 57147 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57147&action=edit reduced testcase (from gcc.dg/c23-tag-composite-3.c) Compiler output: $ x86_64-pc-linux-gnu-gcc -std=c2x -funsigned-bitfields testcase.c testcase.c: In function 'foo': testcase.c:11:3: internal compiler error: in composite_type_internal, at c/c-typeck.cc:557 11 | 1 ? a : c; | ^ 0x6eabe7 composite_type_internal(tree_node*, tree_node*, composite_cache*) /repo/gcc-trunk/gcc/c/c-typeck.cc:557 0xe267e0 composite_type(tree_node*, tree_node*) /repo/gcc-trunk/gcc/c/c-typeck.cc:748 0xe267e0 build_conditional_expr(unsigned int, tree_node*, bool, tree_node*, tree_node*, unsigned int, tree_node*, tree_node*, unsigned int) /repo/gcc-trunk/gcc/c/c-typeck.cc:5733 0xe59a26 c_parser_conditional_expression /repo/gcc-trunk/gcc/c/c-parser.cc:9238 0xe59d64 c_parser_expr_no_commas /repo/gcc-trunk/gcc/c/c-parser.cc:9072 0xe5a1c1 c_parser_expression /repo/gcc-trunk/gcc/c/c-parser.cc:12762 0xe5a697 c_parser_expression_conv /repo/gcc-trunk/gcc/c/c-parser.cc:12802 0xe7c5ef c_parser_statement_after_labels /repo/gcc-trunk/gcc/c/c-parser.cc:7761 0xe516c6 c_parser_compound_statement_nostart /repo/gcc-trunk/gcc/c/c-parser.cc:7248 0xe78d44 c_parser_compound_statement /repo/gcc-trunk/gcc/c/c-parser.cc:6533 0xe7b058 c_parser_declaration_or_fndef /repo/gcc-trunk/gcc/c/c-parser.cc:3017 0xe84c9b c_parser_external_declaration /repo/gcc-trunk/gcc/c/c-parser.cc:2046 0xe85683 c_parser_translation_unit /repo/gcc-trunk/gcc/c/c-parser.cc:1900 0xe85683 c_parse_file() /repo/gcc-trunk/gcc/c/c-parser.cc:26815 0xefb1b1 c_common_parse_file() /repo/gcc-trunk/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. I would even say that with -funsigned-bitfields, the code is valid, but I am not a language lawyer. gcc-13, or gcc-14 without -std=2x, rejects the code though. On the other hand, changing the "unsigned" to "signed", makes the code to be accepted, with the default "signed" bitfields, so "int" and "signed" bitfield types are equal; maybe my understanding of the "-funsigned-bitfields" as "any plain 'int' bitfield is 'unsigned'" is incorrect. $ x86_64-pc-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8251-20240118071416-g48c8d26d771-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ --enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra --disable-bootstrap --with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld --with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-r14-8251-20240118071416-g48c8d26d771-checking-yes-rtl-df-extra-nobootstrap-amd64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 14.0.1 20240118 (experimental) (GCC)