Commit 546ad2d9 by Sebastian Pop Committed by Sebastian Pop

* tree-ssa-loop-niter.c (scev_probably_wraps_p): Reword a comment.

From-SVN: r103152
parent 39c39be0
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> 2005-08-15 Richard Earnshaw <richard.earnshaw@arm.com>
PR target/23355 PR target/23355
......
...@@ -1891,19 +1891,24 @@ scev_probably_wraps_p (tree type, tree base, tree step, ...@@ -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 /* If AT_STMT represents a cast operation, we may not be able to
take advantage of the undefinedness of signed type evolutions. 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 See PR 21959 for a test case. Essentially, given a cast
operation operation
unsigned char i; unsigned char uc;
signed char i.0; signed char sc;
... ...
i.0_6 = (signed char) i_2; sc = (signed char) uc;
if (i.0_6 < 0) if (sc < 0)
... ...
where i_2 and i.0_6 have the scev {0, +, 1}, we would consider where uc and sc have the scev {0, +, 1}, we would consider uc to
i_2 to wrap around, but not i.0_6, because it is of a signed wrap around, but not sc, because it is of a signed type. This
type. This causes VRP to erroneously fold the predicate above causes VRP to erroneously fold the predicate above because it
because it thinks that i.0_6 cannot be negative. */ thinks that sc cannot be negative. */
if (at_stmt && TREE_CODE (at_stmt) == MODIFY_EXPR) if (at_stmt && TREE_CODE (at_stmt) == MODIFY_EXPR)
{ {
tree rhs = TREE_OPERAND (at_stmt, 1); tree rhs = TREE_OPERAND (at_stmt, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment