https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103536
--- Comment #6 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:8e995e84233661a1a246807a66cc84003426b1df commit r14-3722-g8e995e84233661a1a246807a66cc84003426b1df Author: Andrew Pinski <apin...@marvell.com> Date: Sun Sep 3 10:17:29 2023 -0700 MATCH: Add pattern for `(x | y) & (x & z)` Like the pattern already there for `(x | y) & x`, this adds a simple pattern to optimize `(x | y) & (x & z)` to just `x & z`. OK? Bootstrapped and tested on x86-64-linux-gnu with no regressions. gcc/ChangeLog: PR tree-optimization/103536 * match.pd (`(x | y) & (x & z)`, `(x & y) | (x | z)`): New patterns. gcc/testsuite/ChangeLog: PR tree-optimization/103536 * gcc.dg/tree-ssa/andor-6.c: New test. * gcc.dg/tree-ssa/andor-bool-1.c: New test.