From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B5B9A385840A; Thu, 4 Jan 2024 20:52:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B5B9A385840A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704401538; bh=wKhurmVz/GSU+33HZJiYnONxECdCRugQpBVCyR0UGgQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UU2kHH8Hd44lLgBimqDryht3i92n9gftiudqcb9k3ATYuOGydLGp2eZf74fJdj73n YPaRfigfqaFqG1BJ3Q6NEEKYHIUk2uFn1Yz7KcffH5uPI8LSYSC4WSVULDybyAMLdE S/uvD4aIExeEKoPFdLwiAN7xPCrBLJ99cL2L4u3Y= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113186] [13/14 Regression] `(a^c) & (a^!c)` is not optimized to 0 for bool Date: Thu, 04 Jan 2024 20:52:18 +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: normal 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: 14.0 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=3D113186 --- Comment #5 from GCC Commits --- The trunk branch has been updated by Andrew Pinski : https://gcc.gnu.org/g:97def769e6b28832f5ba4087d6fcdd44e18bf005 commit r14-6927-g97def769e6b28832f5ba4087d6fcdd44e18bf005 Author: Andrew Pinski Date: Sun Dec 31 16:38:30 2023 -0800 Match: Improve inverted_equal_p for bool and `^` and `=3D=3D` [PR113186] For boolean types, `a ^ b` is a valid form for `a !=3D b`. This means f= or gimple_bitwise_inverted_equal_p, we catch some inverted value forms. Th= is patch extends inverted_equal_p to allow matching of `^` with the corresponding `=3D=3D`. Note in the testcase provided we used to optimi= ze in GCC 12 to just `return 0` where `a =3D=3D b` was used, this allows us to do that again. Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/113186 gcc/ChangeLog: * gimple-match-head.cc (gimple_bitwise_inverted_equal_p): Match `^` with the `=3D=3D` for 1bit integral types. * match.pd (maybe_cmp): Allow for bit_xor for 1bit integral types. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/bitops-bool-1.c: New test. Signed-off-by: Andrew Pinski =