aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-09-27 17:31:34 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2007-09-27 17:31:34 +0000
commite233ac979c0f179f858f3c86281835a4c09cece2 (patch)
treee09e3c8bc4a42746c82cfe49a69a4098a8e6622b /gcc/tree-cfg.c
parentc304878307f81a770edb0ec08d88c73b5aed074a (diff)
downloadgcc-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/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index fd981f3..320bc8e 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -417,8 +417,7 @@ fold_cond_expr_cond (void)
cond = fold (COND_EXPR_COND (stmt));
zerop = integer_zerop (cond);
onep = integer_onep (cond);
- fold_undefer_overflow_warnings (((zerop || onep)
- && !TREE_NO_WARNING (stmt)),
+ fold_undefer_overflow_warnings (zerop || onep,
stmt,
WARN_STRICT_OVERFLOW_CONDITIONAL);
if (zerop)