From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4CCC23858C31; Thu, 26 Oct 2023 02:52:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4CCC23858C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698288778; bh=/Mv/g0T2fVM/9cAv8Nb1XjbNIvcjhc1TXTRB2Njc4ow=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Z0rZl+dEBfRafOylpxpZ9i+Lx2KAZEiUMdmHErfg+sZsugpXnCko5kl7RSgblCjPo 3iB8VNYwQUman/3Nih1n3sjU8giYZlD9Tzf6d1YrslDKPDZscWbA/1fTduC92NSOsQ uUDg87IPKNIv9n0SRhAKBP1/j0rYNu6cl2jWtTRY= 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: Thu, 26 Oct 2023 02:52:57 +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: UNCONFIRMED 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: see_also 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 ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D101590 --- Comment #1 from Andrew Pinski --- | has a similar issue: ``` int f_or(unsigned a, unsigned b) { return (a|b) <=3D a; } int f1_or(unsigned a, unsigned b) { return (a|b) =3D=3D a; } int g_or(unsigned a, unsigned b) { return (a|b) > a; } int g1_or(unsigned a, unsigned b) { return (a|b) !=3D a; } ``` Note for other comparisons, see PR 101590 which I am about to submit a patch for since they simplify down to a constant.=