https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101590

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---

U | N < U -> false
U & N <= U -> true
U & N > U -> false
U | N >= U -> true

>I don't see an easy way to combine these two patterns though.
I totally missed that the for loop is a pair for.

(for cmp   (lt      ge      le      gt     )
     bitop (bit_ior bit_ior bit_and bit_and)
 (simplify
  (cmp (bitop @0 INTEGER_CST@1) @0)
  (if (INTEGRAL_TYPE_P (TREE_TYPE (@0)) && TREE_UNSIGNED (TREE_TYPE (@0)))
   ({ constant_boolean_node (cmp == GE_EXPR || cmp == LE_EXPR, type); })))

Reply via email to