--- gcc/match.pd.jj     2017-07-17 16:25:20.000000000 +0200
+++ gcc/match.pd        2017-07-18 12:32:52.896924558 +0200
@@ -1125,6 +1125,19 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
        && wi::neg_p (@1, TYPE_SIGN (TREE_TYPE (@1))))
     (cmp @2 @0))))))

+/* (X - 1U) <= INT_MAX-1U into (int) X > 0.  */

Since the transformation applies to other types besides int I
suggest to make it clear in the comment.  E.g., something like:

  /* (X - 1U) <= TYPE_MAX - 1U into (TYPE) X > 0 for any integer
     TYPE.  */

(with spaces around all the operators as per GCC coding style).

Martin

Reply via email to