https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122296
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <[email protected]>: https://gcc.gnu.org/g:128933c9cf232a97e5b85bedacd25dbab961cc88 commit r16-4462-g128933c9cf232a97e5b85bedacd25dbab961cc88 Author: Andrew Pinski <[email protected]> Date: Thu Oct 16 16:10:59 2025 -0700 match: Fix `(a == b) | ((a|b) != 0)` pattern for vectors [PR122296] The pattern `(a == b) | ((a|b) != 0)` uses build_one_cst to build boolean true but boolean can be a signed multi-bit type. So this changes the result to use constant_boolean_node isntead. `(a != b) & ((a|b) == 0)` has a similar issue but in that case it is less likely to be an issue as false is almost always just 0 but this changes it to be consistent. Pushed as obvious after a bootstrap/test on x86_64-linux-gnu. PR tree-optimization/122296 gcc/ChangeLog: * match.pd (`(a == b) | ((a|b) != 0)`): Fix true value. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/int-bwise-opt-vect01.c: New test. Signed-off-by: Andrew Pinski <[email protected]>
