From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 077003858D33; Thu, 18 Jan 2024 20:14:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 077003858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705608885; bh=1Ry1k58PM07HWywJkGyJJuJlHjv+gqvrqit69HEGeXY=; h=From:To:Subject:Date:From; b=phZN8UrT83yxNCSvBvRALmDPn8GPyW5hA/PJN8G/lc9SDQtsU8BvITbzkSiBkHiPs sdR+joNey2nZP5+QQ7ptCgLr5K5aK1wSp82guLycEhE2iyeMGmWo/wUrLigNV0YUwP XlaWlYH93WIldk1ytmGniAbXrXOMhykxJw8va/sM= From: "zsojka at seznam dot cz" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields Date: Thu, 18 Jan 2024 20:14:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zsojka at seznam dot cz X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone cf_gcchost cf_gcctarget attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113492 Bug ID: 113492 Summary: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=3Dc2x -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=3D57147&action=3Dedit reduced testcase (from gcc.dg/c23-tag-composite-3.c) Compiler output: $ x86_64-pc-linux-gnu-gcc -std=3Dc2x -funsigned-bitfields testcase.c=20 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 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=3D2x, 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=3D/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-g= cc COLLECT_LTO_WRAPPER=3D/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=3Dc,c++ --enable-valgrind-annotations --disable-nls --enable-checking=3Dyes,rtl,df,= extra --disable-bootstrap --with-cloog --with-ppl --with-isl --build=3Dx86_64-pc-linux-gnu --host=3Dx86_64-pc-linux-gnu --target=3Dx86_64-pc-linux-gnu --with-ld=3D/usr/bin/x86_64-pc-linux-gnu-ld --with-as=3D/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch --prefix=3D/repo/gcc-trunk//binary-trunk-r14-8251-20240118071416-g48c8d26d7= 71-checking-yes-rtl-df-extra-nobootstrap-amd64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 14.0.1 20240118 (experimental) (GCC)=