OSDN Git Service

For Greta Yorsh.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / ldist-4.c
1 /* { dg-do compile } */ 
2 /* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-all" } */
3
4 int loop1 (int k)
5 {
6   unsigned int i;
7   unsigned int j;
8   int a[100], b[100][100];
9
10   a[0] = k;
11   for (i = 1; i < 100; i ++)
12     {
13       for (j = 0; j < 100; j++)
14         {
15           a[j] = k * i;
16           b[i][j] = a[j-1] + k;
17         }
18     }
19
20   return b[100-1][0];
21 }
22
23 /* We used to distribute also innermost loops, but these could produce
24    too much code in the outer loop, degrading performance of scalar
25    code.  So this test was XFAILed because the cost model of the stand
26    alone distribution pass has evolved.  Now it passes.  */
27 /* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 0 "ldist" { target ilp32 } } } */
28 /* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 1 "ldist" { target lp64 } } } */
29 /* { dg-final { cleanup-tree-dump "ldist" } } */