aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.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/fold-const.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/fold-const.c')
-rw-r--r--gcc/fold-const.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 12413d8..62cbfd1 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -974,6 +974,9 @@ fold_undefer_overflow_warnings (bool issue, const_tree stmt, int code)
if (!issue || warnmsg == NULL)
return;
+ if (stmt != NULL_TREE && TREE_NO_WARNING (stmt))
+ return;
+
/* Use the smallest code level when deciding to issue the
warning. */
if (code == 0 || code > (int) fold_deferred_overflow_code)