From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A49F43858C54; Tue, 10 Oct 2023 17:28:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A49F43858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696958880; bh=PdB/vtK+5Gt2Ti1UmkxWlsvtR3POOqZ1JzjrfzuR5yI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=a07TswRHhd413zROqvGR2mPzVv6qN9NUpS+IYwkS9njul9ctXnT+wapEKXUCVh8m4 wRw4zLc4rlLDZ3DfY1NjCSl9e9m2Rv2xkMTYifpkEbByXGAAJmZAgL+ibEpWtZeD8j AZu9oGqPo7ntBlI4xJ8Fx3OcekJ4aw5R/Dpar5WA= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111679] `(~a) | (a ^ b)` is not simplified to `~(a & b)` Date: Tue, 10 Oct 2023 17:27:59 +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, patch X-Bugzilla-Severity: enhancement X-Bugzilla-Who: cvs-commit 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=3D111679 --- Comment #3 from CVS Commits --- The trunk branch has been updated by Andrew Pinski : https://gcc.gnu.org/g:975da6fa9170c9cf1ec4a9a9d8177f8561d464d1 commit r14-4543-g975da6fa9170c9cf1ec4a9a9d8177f8561d464d1 Author: Andrew Pinski Date: Mon Oct 9 11:07:08 2023 -0700 MATCH: [PR111679] Add alternative simplification of `a | ((~a) ^ b)` So currently we have a simplification for `a | ~(a ^ b)` but that does not match the case where we had originally `(~a) | (a ^ b)` so we need to add a new pattern that matches that and uses bitwise_inverted_equal_p that also catches comparisons too. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/111679 gcc/ChangeLog: * match.pd (`a | ((~a) ^ b)`): New pattern. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/bitops-5.c: New test.=