diff options
author | Richard Biener <rguenther@suse.de> | 2014-10-09 08:20:53 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-10-09 08:20:53 +0000 |
commit | ee68591e69621b4fdbbd925044b66b6147800cf9 (patch) | |
tree | bb758a1c6c30688ffeabdbe9b62736d35f09b005 /gcc/tree-vrp.c | |
parent | 9d55066c88b4c276a969ea2b86614c7bd034f212 (diff) | |
download | gcc-ee68591e69621b4fdbbd925044b66b6147800cf9.zip gcc-ee68591e69621b4fdbbd925044b66b6147800cf9.tar.gz gcc-ee68591e69621b4fdbbd925044b66b6147800cf9.tar.bz2 |
re PR tree-optimization/63445 (request: make -Wstrict-overflow avoid a class of false positives)
2014-10-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/63445
* tree-vrp.c (simplify_cond_using_ranges): Only warn about
overflow for non-equality compares.
* gcc.dg/Wstrict-overflow-26.c: New testcase.
From-SVN: r216028
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 011db78..7ca0528 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -9189,8 +9189,9 @@ simplify_cond_using_ranges (gimple stmt) /* If the range overflowed and the user has asked for warnings when strict overflow semantics were used to optimize code, issue an appropriate warning. */ - if ((is_negative_overflow_infinity (vr->min) - || is_positive_overflow_infinity (vr->max)) + if (cond_code != EQ_EXPR && cond_code != NE_EXPR + && (is_negative_overflow_infinity (vr->min) + || is_positive_overflow_infinity (vr->max)) && issue_strict_overflow_warning (WARN_STRICT_OVERFLOW_CONDITIONAL)) { location_t location; |