From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EA6223858D33; Mon, 4 Sep 2023 06:03:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EA6223858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693807431; bh=wP9uMS2f1eH5NSdcjNHP1+TiUzyBON28xKBoAoCVtN4=; h=From:To:Subject:Date:From; b=G2awYgdzllpnJB2PqMqCAXoqTvw2dbkCh0x9Rnw1IjxSsLaGXnirJeG7HwrLd9oHu 3Z4UC1PlWahx8mOlf9GQzi9nLaQFDA7Ph3tOy6EyTog/OdOcYoTNSZdrRnQnAn23SX phDS3IAAJM4/AAdFCsyCyIZT1tc8uL31o+eQioBY= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111282] New: `a & (b ^ ~a)` (or `a & ~(a ^ b)`) not optimized to `a & b` in gimple Date: Mon, 04 Sep 2023 06:03:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D111282 Bug ID: 111282 Summary: `a & (b ^ ~a)` (or `a & ~(a ^ b)`) not optimized to `a & b` in gimple Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization Assignee: pinskia at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Take: ``` int f(int a, int b) { return a & (b ^ ~a); } `` This should be optimized to `a & b` which it is on the RTL.=