OSDN Git Service

2008-08-20 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-pre-20.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-pre-stats" } */
3
4 double pcheck;
5
6 void foo(int n, int m, int b)
7 {
8   int i, j;
9
10   goto bb18;
11
12 start:
13   i = 1;
14   do {
15     j = 1;
16     do {
17       double x = pcheck;
18       x = x + 1;
19       pcheck = x;
20       j = j + 1;
21     } while (j != m);
22     i = i + 1;
23   } while (i != n);
24
25 bb18:
26   pcheck = 0.0;
27   goto start;
28 }
29
30 /* We should have inserted two PHI nodes and the one in the i-loop
31    should have 0.0 in the argument coming from the bb18 block.  */
32
33 /* { dg-final { scan-tree-dump "New PHIs: 2" "pre" } } */
34 /* { dg-final { scan-tree-dump "PHI <.*0\\\.0" "pre" } } */
35 /* { dg-final { cleanup-tree-dump "pre" } } */