https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96697
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- On the other side, we do have: /* X % Y is smaller than Y. */ (for cmp (lt ge) (simplify (cmp (trunc_mod @0 @1) @1) (if (TYPE_UNSIGNED (TREE_TYPE (@0))) { constant_boolean_node (cmp == LT_EXPR, type); }))) (for cmp (gt le) (simplify (cmp @1 (trunc_mod @0 @1)) (if (TYPE_UNSIGNED (TREE_TYPE (@0))) { constant_boolean_node (cmp == GT_EXPR, type); }))) patterns.