From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 09804385DC3A; Sat, 9 Mar 2024 05:55:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 09804385DC3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709963749; bh=DuqQAShYMVq/pu8AkXSsvB4OLGqCQ4vjL65YwW/8Feo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OufPV3eOf1/WniKaxieMOKy9yn7fd91co05uRb6l1VtlJocbvjGJ2d/v/Ll0apcgd 3XAskwB9d+xQhaogwueADwuGmBQSMC+fGrt28Ot+1wdDY87/B1v/qSlsr1KSPAd4qt P/nLU3HJ+wXim0XKmUVMlN+8TWPv+zLVrBEOmjnQ= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110293] Some `A CMP (A NEEQ 0)` is not simplified in some cases Date: Sat, 09 Mar 2024 05:55:48 +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: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia 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=3D110293 --- Comment #10 from Andrew Pinski --- Here is some more optimizations where the inner CMP is not EQ/NE: signed: x =3D=3D (x <=3D CST) -> CST =3D=3D 0 ? false : CST < 0 ? x =3D=3D 0 : x = =3D=3D 1 x =3D=3D (x < CST) -> CST =3D=3D 1 ? false : CST <=3D 0 ? x =3D=3D 0 : x = =3D=3D 1 unsigned: x =3D=3D (x u<=3D CST) -> CST =3D=3D 0 ? false : x =3D=3D 1 (note 0 should = already be handled) x =3D=3D (x u<=3D CST) -> CST =3D=3D 0 ? x =3D=3D 0 : CST =3D=3D 1 ? false = : x =3D=3D 1 (note 0/1 should be handled already)=