From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 23AF1384A02B; Mon, 21 Dec 2020 12:17:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23AF1384A02B From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/98353] [9/10/11 Regression] ICE in propagate_necessity, at tree-ssa-dce.c:1053 since r6-4886-gcda0a029f45d20f4 Date: Mon, 21 Dec 2020 12:17:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cc Message-ID: In-Reply-To: References: 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: Mon, 21 Dec 2020 12:17:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98353 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek --- On the FE side, I think this can be fixed with: --- gcc/cp/init.c.jj 2020-12-09 09:03:38.270054654 +0100 +++ gcc/cp/init.c 2020-12-21 13:05:33.137218177 +0100 @@ -187,7 +187,7 @@ build_zero_init_1 (tree type, tree nelts else if (NULLPTR_TYPE_P (type)) init =3D build_int_cst (type, 0); else if (SCALAR_TYPE_P (type)) - init =3D fold (convert (type, integer_zero_node)); + init =3D cp_fold_rvalue (convert (type, integer_zero_node)); else if (RECORD_OR_UNION_CODE_P (TREE_CODE (type))) { tree field; It is unclear to me why it uses so arcane way of emitting zero constants, c= an't just build_zero_cst (type); do that?, but if it has to, the complex types c= an't be handled by simple fold as fold is not recursive, and convert emits COMPLEX_EXPR with FLOAT_EXPR of 0 operands, so one needs to fold those oper= ands and only then fold the COMPLEX_EXPR. I guess there is some bug on the gimplifier side too, it shouldn't ICE even when such COMPLEX_EXPRs are not simplified.=