diff options
author | Ian Lance Taylor <iant@google.com> | 2007-09-27 17:31:34 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2007-09-27 17:31:34 +0000 |
commit | e233ac979c0f179f858f3c86281835a4c09cece2 (patch) | |
tree | e09e3c8bc4a42746c82cfe49a69a4098a8e6622b /gcc/testsuite | |
parent | c304878307f81a770edb0ec08d88c73b5aed074a (diff) | |
download | gcc-e233ac979c0f179f858f3c86281835a4c09cece2.zip gcc-e233ac979c0f179f858f3c86281835a4c09cece2.tar.gz gcc-e233ac979c0f179f858f3c86281835a4c09cece2.tar.bz2 |
re PR tree-optimization/33565 (spurious warning: assuming signed overflow does not occur when assuming that (X + c) >= X is always true)
./: PR tree-optimization/33565
* tree-ssa-loop-ch.c (copy_loop_headers): Set TREE_NO_WARNING on
assignments of comparisons.
* tree-ssa-sccvn.c (simplify_binary_expression): Add stmt
parameter. Change caller. Defer overflow warnings around call to
fold_binary.
* fold-const.c (fold_undefer_overflow_warnings): Don't warn if
TREE_NO_WARNING is set on the statement.
* tree-ssa-forwprop.c
(tree_ssa_forward_propagate_single_use_vars): Don't test
TREE_NO_WARNING when calling fold_undefer_overflow_warnings.
* tree-cfg.c (fold_cond_expr_cond): Likewise.
testsuite/:
PR tree-optimization/33565
* gcc.dg/Wstrict-overflow-20.c: New test.
From-SVN: r128840
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/Wstrict-overflow-20.c | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e7b5252..163f80b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-09-27 Ian Lance Taylor <iant@google.com> + + PR tree-optimization/33565 + * gcc.dg/Wstrict-overflow-20.c: New test. + 2007-09-27 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> * gfortran.dg/openmp_stack.f90: Fix typo. diff --git a/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c b/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c new file mode 100644 index 0000000..207162d0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */ + +/* Don't warn about an overflow in a copied loop header. We used to + get a warning in value numbering. This is PR 33565. */ + +void f (int m, int n) +{ + int j; + + for (j = m; j < m + 10 && j < n; j ++) + do_something (j); +} |