Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-14.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 /* PR tree-optimization/83337 */ | |
2 /* { dg-do run { target int32plus } } */ | |
3 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */ | |
4 /* { dg-skip-if "too big data segment" { visium-*-* } } */ | |
5 | |
6 /* Copied from graphite/interchange-5.c */ | |
7 | |
8 #define DEBUG 0 | |
9 #if DEBUG | |
10 #include <stdio.h> | |
11 #endif | |
12 | |
13 #define N 100 | |
14 #define M 1111 | |
15 struct S { int a : 3; int b : 17; int c : 12; }; | |
16 struct S A[N][M]; | |
17 | |
18 static int __attribute__((noinline)) | |
19 foo (void) | |
20 { | |
21 int i, j; | |
22 | |
23 for( i = 0; i < M; i++) | |
24 for( j = 0; j < N; j++) | |
25 A[j][i].b = 5 * A[j][i].b; | |
26 | |
27 return A[0][0].b + A[N-1][M-1].b; | |
28 } | |
29 | |
30 extern void abort (); | |
31 | |
32 static void __attribute__((noinline)) | |
33 init (int i) | |
34 { | |
35 int j; | |
36 | |
37 for (j = 0; j < M; j++) | |
38 A[i][j].b = 2; | |
39 } | |
40 | |
41 int | |
42 main (void) | |
43 { | |
44 int i, j, res; | |
45 | |
46 for (i = 0; i < N; i++) | |
47 init (i); | |
48 | |
49 res = foo (); | |
50 | |
51 #if DEBUG | |
52 fprintf (stderr, "res = %d \n", res); | |
53 #endif | |
54 | |
55 if (res != 20) | |
56 abort (); | |
57 | |
58 return 0; | |
59 } | |
60 | |
61 /* { dg-final { scan-tree-dump-times "Loop_pair<outer:., inner:.> is interchanged" 1 "linterchange"} } */ |