https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110010
--- Comment #4 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:9c40f8de18908bd0e09dafd5e21895d285044e11 commit r17-263-g9c40f8de18908bd0e09dafd5e21895d285044e11 Author: Daniel Henrique Barboza <[email protected]> Date: Fri May 1 14:13:51 2026 -0600 [PATCH v3] match.pd: (A>>C) != (B>>C) -> (A^B) >= (1<<C) [PR110010] Also adding the variant "(A>>C) == (B>>C) -> (A^B) < (1<<C)" Bootstrapped on x86, aarch64 and rv64. Regression tested on x86 and aarch64. Changes from v2: - add type_has_mode_precision_p () check - add types_match() to simplify types comparison - add rshift operand checks (must not be negative, must not surpass type size) - v2 link: https://gcc.gnu.org/pipermail/gcc-patches/2026-March/711284.html PR tree-optimization/110010 gcc/ChangeLog: * match.pd (`(A>>C) NE|EQ (B>>C) -> (A^B) GE|LT (1<<C)`): New pattern. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr110010.c: New test.
