https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111679
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>: https://gcc.gnu.org/g:975da6fa9170c9cf1ec4a9a9d8177f8561d464d1 commit r14-4543-g975da6fa9170c9cf1ec4a9a9d8177f8561d464d1 Author: Andrew Pinski <pins...@gmail.com> 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.