summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr20702.c
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-13 15:33:17 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-13 15:33:17 +0000
commit4efa33ae7e2ae6081af93b99674da4707e2cdb90 (patch)
treebbc563f0437c0a8340dd241f0a15f7d13ce82259 /gcc/testsuite/gcc.dg/tree-ssa/pr20702.c
parentf21dcb286d580bafe85dcfc2a5f817a16fd27fb1 (diff)
downloadgcc-4efa33ae7e2ae6081af93b99674da4707e2cdb90.tar.gz
gcc/
PR tree-optimization/20913 * tree-ssa-copy.c (copy_prop_visit_cond_stmt): Fold COND_EXPR. testsuite/ PR tree-optimization/20913 * gcc.dg/tree-ssa/pr20913.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98091 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/pr20702.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr20702.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr20702.c b/gcc/testsuite/gcc.dg/tree-ssa/pr20702.c
new file mode 100644
index 00000000000..c6f1ae6654f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr20702.c
@@ -0,0 +1,28 @@
+/* PR tree-optimization/20702
+ VRP did not insert ASSERT_EXPRs into dominator dominator children
+ of a basic block ending with COND_EXPR unless the children are also
+ immediate successors of the basic block. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-vrp-details" } */
+
+extern void bar (int);
+
+int
+foo (int *p, int b)
+{
+ int a;
+
+ if (b)
+ bar (123);
+ else
+ bar (321);
+
+ a = *p;
+ if (p == 0)
+ return 0;
+
+ return a;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp"} } */