From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E169D3857039; Wed, 7 Oct 2020 17:22:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E169D3857039 From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/97315] [11 Regression] ICE in choose_value, at gimple-ssa-evrp.c:282 since r11-3690-gebc77ce3a4c70730b4e38d68f88693eadbdc8712 Date: Wed, 07 Oct 2020 17:22:54 +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: 10.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.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: Wed, 07 Oct 2020 17:22:55 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97315 --- Comment #9 from rguenther at suse dot de --- On October 7, 2020 5:35:02 PM GMT+02:00, amacleod at redhat dot com wrote: >https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97315 > >--- Comment #8 from Andrew Macleod --- >(In reply to David Binderman from comment #6) >> I get something similar with this test case: >>=20 >> int a; >> void b() { >> if (a >=3D 2147483647) >> c(a + 1); >> } > >This one is slightly different. > >Still triggering in the same place, but the difference in the singleton >is the >result of the calculation of: > > [+INF, +INF] + 1 > >EVRP is reporting [-INF, -INF], and range-ops is calculating [+INF, >+INF] > >Is there a correct answer, or does it matter?=20=20=20 While we print +inf it's just a value we can apply +1 to in the "do what I mean" sense. So I think for arithmetic we shouldn't saturate, even when overflow is undefined (instead as, you say, UNDEFINED would be the correct optimistic result). >The code we imported for handling overflow always sets the bound to >+INF if an >overflow happens, and it happens on both bounds, so we get [+INF, >+INF]. I'm >guessing because its a single value EVRP actually folded the value >regardless >of overflow?=20=20=20 > >Or maybe it should be UNDEFINED?=20 > >Andrew=