From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 99DBC3858403; Sun, 26 Sep 2021 10:34:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99DBC3858403 From: "luc.briand35 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/102488] New: ICE with default constexpr operator== on class with bitfield Date: Sun, 26 Sep 2021 10:34:39 +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: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: luc.briand35 at gmail dot com 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 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Sep 2021 10:34:39 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102488 Bug ID: 102488 Summary: ICE with default constexpr operator=3D=3D on class with bitfield Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: luc.briand35 at gmail dot com Target Milestone: --- Hello, The following code causes an ICE, the culprit being the constexpr operator= =3D=3D. This only happens on the trunk version (12.0) of gcc. When the bitfield is smaller than 8 bits, there is no crash. Godbolt link: https://gcc.godbolt.org/z/eh57da3cE struct A=20 { unsigned int a : 8; /* no crash for sizes from 1 to 7 and 32 */ constexpr bool operator=3D=3D(const A&) const =3D default; }; int main() { A a{}, b{}; return a =3D=3D b; } Full error message (command: "gcc -c ./test_bug.cpp -std=3Dc++2a"): ./test_bug.cpp: In member function =E2=80=98constexpr bool A::operator=3D= =3D(const A&) const=E2=80=99: ./test_bug.cpp:7:20: error: type mismatch in =E2=80=98component_ref=E2=80=99 7 | constexpr bool operator=3D=3D(const A&) const =3D default; | ^~~~~~~~ unsigned int unsigned char _1 =3D this->a; ./test_bug.cpp:7:20: error: type mismatch in =E2=80=98component_ref=E2=80=99 unsigned int unsigned char _2 =3D D.2080->a; ./test_bug.cpp:7:20: internal compiler error: =E2=80=98verify_gimple=E2=80= =99 failed 0x100bd2d verify_gimple_in_seq(gimple*) ../../gcc-trunk/gcc/tree-cfg.c:5097 0xd40216 gimplify_body(tree_node*, bool) ../../gcc-trunk/gcc/gimplify.c:14876 0xd403f3 gimplify_function_tree(tree_node*) ../../gcc-trunk/gcc/gimplify.c:14966 0xb88907 cgraph_node::analyze() ../../gcc-trunk/gcc/cgraphunit.c:669 0xb8b44f analyze_functions ../../gcc-trunk/gcc/cgraphunit.c:1210 0xb8c032 symbol_table::finalize_compilation_unit() ../../gcc-trunk/gcc/cgraphunit.c:2956 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions.=