diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2014-05-27 19:54:46 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2014-05-27 19:54:46 +0000 |
commit | d378c07ebbb0cf59e9ebd4b2f5912b6ca6f90f1c (patch) | |
tree | e6ac227a3d7680dd7465cbd862d98caa0511d604 /gcc/testsuite/gcc.dg/Wstrict-overflow-25.c | |
parent | 3ce6c715378c93b5ec390b5e8f0732fa93ad9fc8 (diff) | |
download | gcc-d378c07ebbb0cf59e9ebd4b2f5912b6ca6f90f1c.zip gcc-d378c07ebbb0cf59e9ebd4b2f5912b6ca6f90f1c.tar.gz gcc-d378c07ebbb0cf59e9ebd4b2f5912b6ca6f90f1c.tar.bz2 |
fold-const.c (fold_comparison): Clean up and extend X +- C1 CMP C2 to X CMP C2 -+ C1 transformation to...
* fold-const.c (fold_comparison): Clean up and extend X +- C1 CMP C2
to X CMP C2 -+ C1 transformation to EQ_EXPR/NE_EXPR.
Add X - Y CMP 0 to X CMP Y transformation.
(fold_binary_loc) <EQ_EXPR/NE_EXPR>: Remove same transformations.
From-SVN: r210979
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wstrict-overflow-25.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/Wstrict-overflow-25.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wstrict-overflow-25.c b/gcc/testsuite/gcc.dg/Wstrict-overflow-25.c new file mode 100644 index 0000000..0091644 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wstrict-overflow-25.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=3" } */ + +/* We can only simplify the conditional when using strict overflow + semantics. */ + +int +foo (int x, int y) +{ + return x - y < 0; /* { dg-warning "assuming signed overflow does not occur" "correct warning" } */ +} |