diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-27 17:31:34 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-27 17:31:34 +0000 |
commit | 72c59a18cc11b00528f439ea717715b9baddad9d (patch) | |
tree | e09e3c8bc4a42746c82cfe49a69a4098a8e6622b /gcc/tree-ssa-loop-ch.c | |
parent | 06c4be77f669f874fdea3a0576d675cf0fac315a (diff) | |
download | gcc-72c59a18cc11b00528f439ea717715b9baddad9d.tar.gz |
./:
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128840 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-ch.c')
-rw-r--r-- | gcc/tree-ssa-loop-ch.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c index e895981fa31..ff62c686c28 100644 --- a/gcc/tree-ssa-loop-ch.c +++ b/gcc/tree-ssa-loop-ch.c @@ -215,11 +215,22 @@ copy_loop_headers (void) for (i = 0; i < n_bbs; ++i) { - tree last; - - last = last_stmt (copied_bbs[i]); - if (TREE_CODE (last) == COND_EXPR) - TREE_NO_WARNING (last) = 1; + block_stmt_iterator bsi; + + for (bsi = bsi_start (copied_bbs[i]); + !bsi_end_p (bsi); + bsi_next (&bsi)) + { + tree stmt = bsi_stmt (bsi); + if (TREE_CODE (stmt) == COND_EXPR) + TREE_NO_WARNING (stmt) = 1; + else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT) + { + tree rhs = GIMPLE_STMT_OPERAND (stmt, 1); + if (COMPARISON_CLASS_P (rhs)) + TREE_NO_WARNING (stmt) = 1; + } + } } } |