diff gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c	Fri Oct 27 22:46:09 2017 +0900
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats -fno-tree-loop-im" } */
+
+double pcheck;
+
+void foo(int n, int m, int b)
+{
+  int i, j;
+
+  goto bb18;
+
+start:
+  i = 1;
+  do {
+    j = 1;
+    do {
+      double x = pcheck;
+      x = x + 1;
+      pcheck = x;
+      j = j + 1;
+    } while (j != m);
+    i = i + 1;
+  } while (i != n);
+
+bb18:
+  pcheck = 0.0;
+  goto start;
+}
+
+/* We should have inserted two PHI nodes and the one in the i-loop
+   should have 0.0 in the argument coming from the bb18 block.  */
+
+/* { dg-final { scan-tree-dump "New PHIs: 2" "pre" } } */
+/* { dg-final { scan-tree-dump "PHI <.*0\\\.0" "pre" } } */