diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-04 18:29:08 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-04 18:29:08 +0000 |
commit | dd7d1eeb56a38857423c6d830b4c3cce82c8f3a7 (patch) | |
tree | 2841ad7e8a81f46f25e504c978974cc370a0a2ec /gcc/tree-ssa-loop-niter.c | |
parent | 0c04d3f5ef5ca379a6d9cec3555151269a4f5557 (diff) | |
download | gcc-dd7d1eeb56a38857423c6d830b4c3cce82c8f3a7.tar.gz |
2008-08-04 Richard Guenther <rguenther@suse.de>
PR middle-end/36691
* tree-ssa-loop-niter.c (number_of_iterations_lt_to_ne): Correctly
check for no_overflow.
* gcc.c-torture/execute/pr36691.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138645 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r-- | gcc/tree-ssa-loop-niter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 83baae7828a..1d0605e68b5 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -697,7 +697,7 @@ number_of_iterations_lt_to_ne (tree type, affine_iv *iv0, affine_iv *iv1, /* The final value of the iv is iv1->base + MOD, assuming that this computation does not overflow, and that iv0->base <= iv1->base + MOD. */ - if (!iv1->no_overflow && !integer_zerop (mod)) + if (!iv0->no_overflow && !integer_zerop (mod)) { bound = fold_build2 (MINUS_EXPR, type, TYPE_MAX_VALUE (type1), tmod); @@ -719,7 +719,7 @@ number_of_iterations_lt_to_ne (tree type, affine_iv *iv0, affine_iv *iv1, /* The final value of the iv is iv0->base - MOD, assuming that this computation does not overflow, and that iv0->base - MOD <= iv1->base. */ - if (!iv0->no_overflow && !integer_zerop (mod)) + if (!iv1->no_overflow && !integer_zerop (mod)) { bound = fold_build2 (PLUS_EXPR, type1, TYPE_MIN_VALUE (type1), tmod); |