aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/pr21829.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr21829.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c
index 2f7078c..6b5c4bb 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-phicprop-details" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-cddce2" } */
int test(int v)
{
@@ -16,6 +16,33 @@ int test(int v)
return x;
}
-/* { dg-final { scan-tree-dump-times "Original statement:.*% 2\[ \t\n]*Updated statement.*=1" 0 "phicprop2" } } */
-/* { dg-final { cleanup-tree-dump "phicprop\[1-2\]" } } */
+/* This should be optimized to
+ if (v <= 0) goto <L1>; else goto <L3>;
+
+ <L1>:;
+
+ # x_1 = PHI <0(3), 1(1)>;
+ <L3>:;
+ return x_1;
+
+ retaining only a single conditional. This doesn't work as nobody
+ combines the two tests
+
+ if (v < 0) goto <bb 4>; else goto <bb 3>;
+
+ <bb 3>:
+
+ if (v <= 0) goto <bb 4>; else goto <bb 5>;
+
+ this late in the game. tree-ssa-ifcombine.c would do it if we would
+ unroll the loop during early loop unrolling though.
+
+ For now vrp2 does all the needed folding and threading and cddce2
+ provides a nice IL to scan. */
+
+/* { dg-final { scan-tree-dump-times "if " 1 "optimized" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "if " 2 "cddce2" } } */
+/* { dg-final { scan-tree-dump "x_. = PHI <0\\\(.\\\), 1\\\(.\\\)>" "cddce2" } } */
+/* { dg-final { cleanup-tree-dump "cddce2" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */