libstdc++: Make some _Hashtable members inline
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / loop-interchange-9.c
blobb5fda2d5097f7f4624bee03bf1c86ada9e915318
1 /* { dg-do run } */
2 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
3 /* { dg-require-effective-target size20plus } */
4 /* { dg-skip-if "too big data segment" { visium-*-* } } */
6 #define M 256
7 int a[M][M], b[M][M], c[M], d[M];
8 void __attribute__((noinline))
9 simple_reduc_1 (int n)
11 for (int j = 0; j < n; j++)
13 int sum = c[j];
14 for (int i = 0; i < n; i++)
15 sum = sum + a[i][j]*b[i][j];
17 c[j] = sum;
21 void __attribute__((noinline))
22 simple_reduc_2 (int n)
24 for (int j = 0; j < n; j++)
26 int sum = d[j];
27 for (int i = 0; i < n; i++)
28 sum = sum + a[i][j]*b[i][j];
30 asm volatile ("" ::: "memory");
31 d[j] = sum;
35 extern void abort ();
37 static void __attribute__((noinline))
38 init (int i)
40 c[i] = 0;
41 d[i] = 0;
42 for (int j = 0; j < M; j++)
44 a[i][j] = i;
45 b[i][j] = j;
49 int main (void)
51 for (int i = 0; i < M; ++i)
52 init (i);
54 simple_reduc_1 (M);
55 simple_reduc_2 (M);
57 for (int i = 0; i < M; ++i)
58 if (c[i] != d[i])
59 abort ();
61 return 0;
64 /* { dg-final { scan-tree-dump-times "Loop_pair<outer:., inner:.> is interchanged" 1 "linterchange" } } */