Remove the temporary array for reductions written to memory.
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / graphite / interchange-15.c
blob9eeef66173150091def4c48bdb58be2345fbc221
1 /* { dg-require-effective-target size32plus } */
3 #define DEBUG 0
4 #if DEBUG
5 #include <stdio.h>
6 #endif
8 #define NMAX 2000
10 static int x[NMAX], a[NMAX][NMAX];
12 static int __attribute__((noinline))
13 mvt (long N)
15 int i,j;
17 /* These two loops should be interchanged. */
18 for (i = 0; i < N; i++)
19 for (j = 0; j < N; j++)
20 x[i] += a[j][i];
22 return x[1];
25 extern void abort ();
27 int
28 main (void)
30 int i, j, res;
32 for (i = 0; i < NMAX; i++)
33 for (j = 0; j < NMAX; j++)
34 a[i][j] = j;
36 for (i = 0; i < NMAX; i++)
37 x[i] = i;
39 res = mvt (NMAX);
41 #if DEBUG
42 fprintf (stderr, "res = %d \n", res);
43 #endif
45 if (res != 2001)
46 abort ();
48 return 0;
51 /* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
52 /* { dg-final { cleanup-tree-dump "graphite" } } */