summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-26 03:49:20 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-26 03:49:20 +0000
commit6285cf634f3fb495594dede4c4df82750790d6cf (patch)
tree46e58ccdccdc24fd647e7fd019278bafcdc726f2 /gcc/testsuite
parent9eb2d4412d9af2ccbd2256f8fca8ce6747f8bf13 (diff)
downloadppe42-gcc-6285cf634f3fb495594dede4c4df82750790d6cf.tar.gz
ppe42-gcc-6285cf634f3fb495594dede4c4df82750790d6cf.zip
gcc/
PR tree-optimization/22026 * tree-vrp.c (extract_range_from_binary_expr): Drop to VR_VARYING if a binary expression involving VR_ANTI_RANGE is PLUS_EXPR, MINUS_EXPR, or unsigned MULT_EXPR. testsuite/ PR tree-optimization/22026 * gcc.dg/tree-ssa/pr22026.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101328 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr22026.c49
2 files changed, 54 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 419e012bd44..71961848bd3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-26 Kazu Hirata <kazu@codesourcery.com>
+
+ PR tree-optimization/22026
+ * gcc.dg/tree-ssa/pr22026.c: New.
+
2005-06-25 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/21144
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr22026.c b/gcc/testsuite/gcc.dg/tree-ssa/pr22026.c
new file mode 100644
index 00000000000..e56e4a124ad
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr22026.c
@@ -0,0 +1,49 @@
+/* PR tree-optimization/22026
+ VRP used think that ~[0,0] + ~[0,0] = ~[0,0], which is wrong. The
+ same applies to subtraction and unsigned multiplication. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp" } */
+
+int
+plus (int x, int y)
+{
+ if (x != 0)
+ if (y != 0)
+ {
+ int z = x + y;
+ if (z != 0)
+ return 1;
+ }
+ return 0;
+}
+
+int
+minus (int x, int y)
+{
+ if (x != 0)
+ if (y != 0)
+ {
+ int z = x - y;
+ if (z != 0)
+ return 1;
+ }
+ return 0;
+}
+
+int
+mult (unsigned x, unsigned y)
+{
+ if (x != 0)
+ if (y != 0)
+ {
+ unsigned z = x * y;
+ if (z != 0)
+ return 1;
+ }
+ return 0;
+}
+
+/* None of the predicates can be folded in these functions. */
+/* { dg-final { scan-tree-dump-times "Folding predicate" 0 "vrp" } } */
+/* { dg-final { cleanup-tree-dump "vrp" } } */
OpenPOWER on IntegriCloud