https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106164
--- Comment #13 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:ac0e0966ebf08c454d53042a649403e2880ccbc1 commit r14-2887-gac0e0966ebf08c454d53042a649403e2880ccbc1 Author: Andrew Pinski <apin...@marvell.com> Date: Sat Jul 29 21:52:31 2023 -0700 MATCH: Add `a == b | a cmp b` and `a != b & a cmp b` simplifications Even though these are done by combine_comparisons, we can add them to match to allow simplifcations during match rather than just during reassoc/ifcombine. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: PR tree-optimization/106164 * match.pd (`a != b & a <= b`, `a != b & a >= b`, `a == b | a < b`, `a == b | a > b`): Handle these cases too. gcc/testsuite/ChangeLog: PR tree-optimization/106164 * gcc.dg/tree-ssa/cmpbit-2.c: New test.