From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1167F3857C68; Mon, 18 Dec 2023 19:40:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1167F3857C68 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1702928434; bh=9gzO2rMIgHgQVqRaWwLxxO+UrTWTWcvuBSmUg9yzpvA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SRCENpVI2ETxEO3fVQX5tji5xcc7AFSncO9z8T6yfAuDC18aV7SfDzB8L9l5G1u70 a+fmADl8eb6KHDNg1lNhxBwdjxbrs0CjiigFy3Zea/c/3jU4pWopRiB77xoW4/9kRC xop8blNDwnYI6IlcVBSU22xYtGQLApib79hUDBi0= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113072] `(a ^ CST0) & (~a ^ CST0)` is not optimized to 0 at the gimple level Date: Mon, 18 Dec 2023 19:40:33 +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: TREE 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=3D113072 --- Comment #4 from Andrew Pinski --- Note this applies to `|` instead of `&` too: ``` int foo1(int a, int b) { return (a ^ 4) | (~a ^ 4); } ``` This should be optimized to `-1`. Though this does NOT get optimized to `-1= ` on the RTL level ...=