diff options
author | Kazu Hirata <kazu@codesourcery.com> | 2005-12-22 04:03:32 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2005-12-22 04:03:32 +0000 |
commit | c078a43735c62e3f90ac80ba1ae01e6d0b83baba (patch) | |
tree | 66a616b689f118212742fb5cadb2a0578277dd95 /gcc/testsuite | |
parent | 8ad4c89538959cda77bcf90164c79b4b74f9f602 (diff) | |
download | gcc-c078a43735c62e3f90ac80ba1ae01e6d0b83baba.zip gcc-c078a43735c62e3f90ac80ba1ae01e6d0b83baba.tar.gz gcc-c078a43735c62e3f90ac80ba1ae01e6d0b83baba.tar.bz2 |
re PR middle-end/23518 (some gcc optimizations do not take overflow into account with -fwrapv)
gcc/
PR tree-optimization/23518
* fold-const.c (make_range): Don't move a constant to the
other side of the comparison if the type is signed and -fwrapv
is given.
gcc/testsuite/
PR tree-optimization/23518
* testsuite/gcc.dg/pr23518.c: New.
From-SVN: r108940
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr23518.c | 21 |
2 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b788e59..acfd2c8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-12-22 Kazu Hirata <kazu@codesourcery.com> + + PR tree-optimization/23518 + * testsuite/gcc.dg/pr23518.c: New. + 2005-12-21 Mike Stump <mrs@apple.com> * gcc.dg/attr-weakref-1.c: Really skip on darwin. diff --git a/gcc/testsuite/gcc.dg/pr23518.c b/gcc/testsuite/gcc.dg/pr23518.c new file mode 100644 index 0000000..3c6bd275 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr23518.c @@ -0,0 +1,21 @@ +/* PR tree-optimization/23518. + make_range used to transform a + 1 < 0 into a < -1 even when a is + signed and -fwrapv is given. Make sure that no longer happens. */ + +/* { dg-do run } */ +/* { dg-options "-O2 -fwrapv" } */ + +#include <limits.h> + +extern void abort (void); +extern void exit (int); + +int +main (void) +{ + int a = INT_MAX; + if ((a < 0) || (a + 1 < 0)) + exit (0); + + abort (); +} |