aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr21001.c20
2 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b683caf..b4e22d5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2005-04-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR tree-optimization/21001
+ * gcc.dg/tree-ssa/pr21001.c: New.
+
2005-04-17 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/21075
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21001.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21001.c
new file mode 100644
index 0000000..c274cd3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21001.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/21001
+ VRP did not insert ASSERT_EXPRs when the variable tested in a
+ COND_EXPR is a single-use variable. By propagating the definition
+ of the single-use variable into the COND_EXPR, we can get useful
+ range infomation out of the conditional. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-vrp-details" } */
+
+int
+foo (int a)
+{
+ int b = a != 0;
+ if (b)
+ if (a != 0)
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp"} } */