From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B8BDD3858D3C; Sat, 4 Nov 2023 21:10:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B8BDD3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699132235; bh=6UQhi1jA3IWWuNsahITfvdqS72zWLQfI1KL/k2ugNOc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FER+A7wXYez2LoDvmvJ/k8vHXKN6Tf+AtNrRvG1uanOZiAM8L32Spictv03CrKSTl AA+lZoz9tGjZC1qPlnCd8Q/Gaov2F3S0Z5nDLxwSw/b2TvULFAToeaLIuc4f8aMvDV UflevTE2zbC29D1LRbbvvnqW/Z6hdnR/aqQagZAE= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112093] (X & Y) < X (unsigned) and (X & Y) != X should produce the same code Date: Sat, 04 Nov 2023 21:10:35 +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: bug_status cf_reconfirmed_on everconfirmed assigned_to 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=3D112093 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2023-11-04 Ever confirmed|0 |1 Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot = gnu.org --- Comment #2 from Andrew Pinski --- (for cmp (lt ge le gt ) bop (bit_and bit_and bit_ior bit_ior) rcmp (ne eq eq ne ) (simplify (cmp (bop@2 @0 @1) @0) (if (tree_expr_nonnegative_p (@0) && (bop =3D=3D BIT_AND || tree_expr_nonnegative_p (@1))) (rcmp @2 @0)))) I have not looked into what is needed for the IOR case for !tree_expr_nonnegative_p (@1) yet but I suspect it is similar to what I did= for PR 101590. Anyways mine.=