From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 87BCE3858D33; Fri, 22 Dec 2023 21:04:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 87BCE3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703279044; bh=oMy+92CA92C268XoJu11gpt9PPOWfvuELdVHHr9KxX4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=H5zjwAQeyUW4W0ifjFeiX9I6FMAHPpZJdGWm8C93Zn0Wzno84kfkkYAoKkTA9/xze jqduyzNHoNLlAqYP1yDEHXgXCuw+LpqAZMhQ6t+zGCPMUaLpq7aBpmPty3jBI8S417 S6HPsEEFKlK9pKNKWIx+3TDxrGyls7zxQ2MWw3Iw= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113119] ICE: verify_ssa failed: definition in block 18 does not dominate use in block 4 at -O1 with _BitInt Date: Fri, 22 Dec 2023 21:04:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org 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: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113119 --- Comment #1 from Jakub Jelinek --- Without the second redundant __builtin_add_overflow, we get a.0_1 =3D a; _7 =3D .ADD_OVERFLOW (a.0_1, 0); _2 =3D REALPART_EXPR <_7>; _3 =3D IMAGPART_EXPR <_7>; _4 =3D (_Bool) _3; c =3D _4; _5 =3D (_BitInt(8)) _2; b =3D _5; before bitint lowering and lower it well, but the redundant call results in a.0_1 =3D a; _7 =3D .ADD_OVERFLOW (a.0_1, 0); _2 =3D IMAGPART_EXPR <_7>; _3 =3D (_Bool) _2; c =3D _3; _4 =3D REALPART_EXPR <_7>; _5 =3D (_BitInt(8)) _4; b =3D _5; and optimizable_arith_overflow doesn't flag that as non-optimizable, so the bitint lowering of .ADD_OVERFLOW happens in that case on the REALPART_E= XPR stmt. optimizable_arith_overflow checks if both REALPART_EXPR and IMAGPART_EXPR appear in the same bb (and that there are no other uses), but doesn't check that REALPART_EXPR is first. Either it should check that or perhaps allow = it first but require that it is not used in statements before the REALPART_EXP= R.=