diff options
author | Ian Lance Taylor <iant@google.com> | 2007-06-05 13:18:22 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2007-06-05 13:18:22 +0000 |
commit | 3fe5bcaf11efc74817ef5b4d0b612b6f5cb21388 (patch) | |
tree | fac4c70bb3a0a0a1d278aa6d8e22121f701e942b /gcc/testsuite/gcc.dg/Wstrict-overflow-19.c | |
parent | a176d60f9d8fab161a44994bbd37b883d995e428 (diff) | |
download | gcc-3fe5bcaf11efc74817ef5b4d0b612b6f5cb21388.zip gcc-3fe5bcaf11efc74817ef5b4d0b612b6f5cb21388.tar.gz gcc-3fe5bcaf11efc74817ef5b4d0b612b6f5cb21388.tar.bz2 |
tree-vrp.c (compare_values_warnv): Check TREE_NO_WARNING on a PLUS_EXPR or MINUS_EXPR node before setting...
./: * tree-vrp.c (compare_values_warnv): Check TREE_NO_WARNING on a
PLUS_EXPR or MINUS_EXPR node before setting *strict_overflow_p.
(extract_range_from_assert): Set TREE_NO_WARNING when creating an
expression.
(test_for_singularity): Likewise.
testsuite/:
* gcc.dg/Wstrict-overflow-19.c: New test.
From-SVN: r125334
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wstrict-overflow-19.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/Wstrict-overflow-19.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wstrict-overflow-19.c b/gcc/testsuite/gcc.dg/Wstrict-overflow-19.c new file mode 100644 index 0000000..daf98b0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wstrict-overflow-19.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */ + +/* Don't warn about an overflow when threading jumps. We used to get + a warning from comparing bounds generated by VRP. */ + +int +bar(int a, int b, int n) +{ + if (b > a) + n = a - b; + if (a >= b) + n = 1; + return n; +} |