From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E8E293858C41; Fri, 9 Jun 2023 22:28:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E8E293858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686349734; bh=isdXq8e99hOoOTUfUFi0ci9ps/dpmJ4aPNLa5RgkayY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Aj+FGOt4cnsgo51rn2Swpnn11H7wG4xtS+yZG5qfINd19lJxSSpMXyghSoW8GnopF YK1BgU2iuok1DvoMW1WPt6+hy3SccOWRIteTT1ihmBO/+yFljAt6mrm8+2oxqzO8Ij jvxfTDha7Oa+S7rhEgybkc2czImuVTDVCshy/lOc= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/88575] gcc got confused by different comparison operators Date: Fri, 09 Jun 2023 22:28: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: 9.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia 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: dependson 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=3D88575 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |110199 --- Comment #6 from Andrew Pinski --- (In reply to Andrew Pinski from comment #5) > So VRP handles floating point now but it still does not optimize it: > Folding statement: if (a_2(D) <=3D b_3(D)) > Registering value_relation (a_2(D) <=3D b_3(D)) on (2->3) >=20 > Visiting conditional with predicate: if (a_2(D) <=3D b_3(D)) >=20 > With known ranges > a_2(D): [frange] double VARYING b_3(D): [frange] double VARYING >=20 > Predicate evaluates to: DON'T KNOW > Not folded > Folding statement: _4 =3D MIN_EXPR ; > Not folded >=20 >=20 > While the int does this: > Folding statement: _4 =3D MIN_EXPR ; > folding with relation a_2(D) <=3D b_3(D) > Global Exported: _4 =3D [irange] int [-INF, 2147483646] > Not folded >=20 > Which is a regression from GCC 12 .... I filed PR 110199 for that. Maybe once that is fixed the FP case will work too. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110199 [Bug 110199] [12/13/14 Regression] Missing VRP transformation with MIN_EXPR= and known relation=