* tree-ssa-loop-niter.c (scev_probably_wraps_p): Reword a comment.
authorSebastian Pop <pop@cri.ensmp.fr>
Tue, 16 Aug 2005 09:41:33 +0000 (11:41 +0200)
committerSebastian Pop <spop@gcc.gnu.org>
Tue, 16 Aug 2005 09:41:33 +0000 (09:41 +0000)
From-SVN: r103152

gcc/ChangeLog
gcc/tree-ssa-loop-niter.c

index 24be81187b794389d4e38b77e147197e99914406..c9df105860083041583c948396bd5f4981bee178 100644 (file)
@@ -1,3 +1,7 @@
+2005-08-16  Sebastian Pop  <pop@cri.ensmp.fr>
+
+       * tree-ssa-loop-niter.c (scev_probably_wraps_p): Reword a comment.
+
 2005-08-15  Richard Earnshaw  <richard.earnshaw@arm.com>
 
        PR target/23355
index 8399faf30e2335240a8e551f93bd5e9ab831ab7c..ce4b3cf7df195052bc368cbe168d8bccc7ee7f93 100644 (file)
@@ -1891,19 +1891,24 @@ scev_probably_wraps_p (tree type, tree base, tree step,
 
   /* If AT_STMT represents a cast operation, we may not be able to
      take advantage of the undefinedness of signed type evolutions.
+
+     implement-c.texi states: "For conversion to a type of width
+     N, the value is reduced modulo 2^N to be within range of the
+     type;"
+
      See PR 21959 for a test case.  Essentially, given a cast
      operation
-               unsigned char i;
-               signed char i.0;
+               unsigned char uc;
+               signed char sc;
                ...
-               i.0_6 = (signed char) i_2;
-               if (i.0_6 < 0)
+               sc = (signed char) uc;
+               if (sc < 0)
                  ...
 
-     where i_2 and i.0_6 have the scev {0, +, 1}, we would consider
-     i_2 to wrap around, but not i.0_6, because it is of a signed
-     type.  This causes VRP to erroneously fold the predicate above
-     because it thinks that i.0_6 cannot be negative.  */
+     where uc and sc have the scev {0, +, 1}, we would consider uc to
+     wrap around, but not sc, because it is of a signed type.  This
+     causes VRP to erroneously fold the predicate above because it
+     thinks that sc cannot be negative.  */
   if (at_stmt && TREE_CODE (at_stmt) == MODIFY_EXPR)
     {
       tree rhs = TREE_OPERAND (at_stmt, 1);