From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 50DFE3858D28; Sun, 18 Jun 2023 19:24:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 50DFE3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687116295; bh=bQVbiG5Xw+wVhGGDJDLOYd3X3Dlo2p7TX8BD6gks688=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tMCojZ+QI1pmU0ba8CXR/EtDZJEGJnrxl/lqgCcGd0PG9SBIFIGWW24vOK+lOwNq/ /SfHOYz4gIimKYAcsJL1KwmsbPKb/OTueaZ3qvaIKupYQTmVVCEHXWQL8kHawPyyJ2 03WMsffoCdgA1MobLupsbyeyX/1Ngb45z6yRI9+s= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/95185] Failure to optimize specific kind of sign comparison check Date: Sun, 18 Jun 2023 19:24: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: 11.0 X-Bugzilla-Keywords: easyhack, missed-optimization X-Bugzilla-Severity: normal 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: 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=3D95185 --- Comment #5 from Andrew Pinski --- _1 =3D x_4(D) >=3D 0; _2 =3D y_5(D) <=3D 0; _3 =3D _1 =3D=3D _2; Something like: Prefer ^ over =3D=3D ``` (for cmp (for cmpN (for neeq (simplify (neeq:c (cmp @0 @1) @3 (if (cmpN =3D=3D inverseof(cmp, TREE_TYPE (type)) (bit_xor (cmpN @0 @1) @3) ) ) ))) ``` This is what clang seems to do rather than any magic around =3D=3D really. I do wonder if we should try to expand bool =3D=3D bool as bool^bool^1 .=