public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.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 [thread overview] Message-ID: <bug-113186-4-IsJPWmM2NV@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-113186-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113186 --- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>: https://gcc.gnu.org/g:97def769e6b28832f5ba4087d6fcdd44e18bf005 commit r14-6927-g97def769e6b28832f5ba4087d6fcdd44e18bf005 Author: Andrew Pinski <quic_apinski@quicinc.com> Date: Sun Dec 31 16:38:30 2023 -0800 Match: Improve inverted_equal_p for bool and `^` and `==` [PR113186] For boolean types, `a ^ b` is a valid form for `a != b`. This means for gimple_bitwise_inverted_equal_p, we catch some inverted value forms. This patch extends inverted_equal_p to allow matching of `^` with the corresponding `==`. Note in the testcase provided we used to optimize in GCC 12 to just `return 0` where `a == 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 `==` 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 <quic_apinski@quicinc.com>
next prev parent reply other threads:[~2024-01-04 20:52 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-12-31 21:07 [Bug tree-optimization/113186] New: " pinskia at gcc dot gnu.org 2023-12-31 21:07 ` [Bug tree-optimization/113186] " pinskia at gcc dot gnu.org 2023-12-31 21:15 ` pinskia at gcc dot gnu.org 2024-01-01 0:49 ` pinskia at gcc dot gnu.org 2024-01-01 4:04 ` pinskia at gcc dot gnu.org 2024-01-04 20:52 ` cvs-commit at gcc dot gnu.org [this message] 2024-01-04 20:52 ` pinskia at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-113186-4-IsJPWmM2NV@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).