https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119196
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Victor Do Nascimento <victor...@gcc.gnu.org>: https://gcc.gnu.org/g:f33cc3af8fd9c498bd02623168054d76a0989ed6 commit r16-2134-gf33cc3af8fd9c498bd02623168054d76a0989ed6 Author: Icen Zeyada <icen.zeya...@arm.com> Date: Wed Jul 9 12:57:17 2025 +0100 gimple-fold: extend vector simplification to match scalar bitwise optimizations [PR119196] Generalize existing scalar gimple_fold rules to apply the same bitwise comparison simplifications to vector types. Previously, an expression like (x < y) && (x > y) would fold to `false` if x and y are scalars, but equivalent vector comparisons were left untouched. This patch enables folding of patterns of the form (cmp x y) bit_and (cmp x y) (cmp x y) bit_ior (cmp x y) (cmp x y) bit_xor (cmp x y) for vector operands as well, ensuring consistent optimization across all data types. gcc/ChangeLog: PR tree-optimization/119196 * match.pd: Allow scalar optimizations with bitwise AND/OR/XOR to apply to vectors. gcc/testsuite/ChangeLog: * gcc.target/aarch64/vector-compare-5.c: Add new test for vector compare simplification. Signed-off-by: Icen Zeyada <icen.zeya...@arm.com>