Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1.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 -fassociative-math -fno-signed-zeros -fno-trapping-math -fdump-tree-linterchange-details" } */ | |
3 /* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */ | |
4 | |
5 /* Copied from graphite/interchange-4.c */ | |
6 | |
7 #define DEBUG 0 | |
8 #if DEBUG | |
9 #include <stdio.h> | |
10 #endif | |
11 | |
12 double u[1782225]; | |
13 | |
14 static int __attribute__((noinline)) | |
15 foo (int N, int *res) | |
16 { | |
17 int i, j; | |
18 double sum = 0; | |
19 for (i = 0; i < N; i++) | |
20 for (j = 0; j < N; j++) | |
21 sum = sum + u[i + 1335 * j]; | |
22 | |
23 for (i = 0; i < N; i++) | |
24 u[1336 * i] *= 2; | |
25 | |
26 *res = sum + N + u[1336 * 2] + u[1336]; | |
27 } | |
28 | |
29 extern void abort (); | |
30 | |
31 int | |
32 main (void) | |
33 { | |
34 int i, j, res; | |
35 | |
36 for (i = 0; i < 1782225; i++) | |
37 u[i] = 2; | |
38 | |
39 foo (1335, &res); | |
40 | |
41 #if DEBUG | |
42 fprintf (stderr, "res = %d \n", res); | |
43 #endif | |
44 | |
45 if (res != 3565793) | |
46 abort (); | |
47 | |
48 return 0; | |
49 } | |
50 | |
51 /* { dg-final { scan-tree-dump-times "Loop_pair<outer:., inner:.> is interchanged" 1 "linterchange"} } */ |