From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 08825384BC11; Mon, 19 Jul 2021 19:11:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 08825384BC11 From: "amacleod at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/101497] [12 Regression] ice in type, at value-range.h:221 Date: Mon, 19 Jul 2021 19:11:10 +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: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: amacleod at redhat dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 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 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, 19 Jul 2021 19:11:11 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101497 --- Comment #5 from Andrew Macleod --- uc_1.0_1 =3D uc_1; _2 =3D (int) uc_1.0_1;=20=20=20=20 _3 =3D 211 - _2; _3 evaluates as 211 - [-128, 127], or [84, 339] _4 =3D _3 > 0; _5 =3D (int) _4; func_12_uli_6 =3D _5; i_4.1_6 =3D i_4; _7 =3D i_4.1_6 % 0; We changed it so that anything mod 0 was undefined. so _7 is UNDEFINED. i_4 =3D _7; _11 =3D _3 > 0; _3 i s[84, 339] meaning _11 always evaluates TRUE. _10 =3D _11 ? _7 : 0; The code for COND_EXPR confirms the types match when it folds. In this case, the result is UNDEFINED.. undefined has no type, so we need to add a check = for that.=