https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119420
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jeff Law <[email protected]>: https://gcc.gnu.org/g:3d83dd50bc9aed347570e453dfa60f1a69ea4e5a commit r17-266-g3d83dd50bc9aed347570e453dfa60f1a69ea4e5a Author: Jeff Law <[email protected]> Date: Fri May 1 15:27:48 2026 -0600 [PATCH v3] match.pd: (A>>bool) == 0 -> (unsigned)A) <= bool [PR119420] Also add its counterpart: "(A>>bool) != 0 -> (unsigned)A) > bool" Changes from v2: - gate the pattern with "#if GIMPLE" - use 'single_use' in the rshift result - add the NE variant - v2 link: https://gcc.gnu.org/pipermail/gcc-patches/2026-April/712431.html Bootstrap tested in x86, aarch64 and RISC-V. Regression tested in x86 and aarch64. PR tree-optimization/119420 gcc/ChangeLog * match.pd(`(A>>bool) EQ 0 -> (unsigned)A LE bool`): New pattern. gcc/testsuite/ChangeLog * gcc.dg/tree-ssa/pr119420.c: New test.
