comparison gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* { dg-do run } */
2 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
3 /* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
4
5 #define M 256
6 int a[M][M], b[M][M];
7 int __attribute__((noinline))
8 double_reduc (int n)
9 {
10 int sum = 0;
11 for (int j = 0; j < n; j++)
12 {
13 for (int i = 0; i < n; i++)
14 sum = sum + a[i][j]*b[i][j];
15 }
16 return sum;
17 }
18
19 extern void abort ();
20
21 static void __attribute__((noinline))
22 init (int i)
23 {
24 for (int j = 0; j < M; j++)
25 {
26 a[i][j] = i;
27 b[i][j] = j;
28 }
29 }
30
31 int main (void)
32 {
33 for (int i = 0; i < M; ++i)
34 init (i);
35
36 int sum = double_reduc (M);
37
38 if (sum != 1065369600)
39 abort ();
40
41 return 0;
42 }
43
44 /* { dg-final { scan-tree-dump-times "Loop_pair<outer:., inner:.> is interchanged" 1 "linterchange" } } */