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 /* 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 void __attribute__((noinline)) foo(int N,double * res)15foo (int N, double *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 *res = sum; 24 } 25 26 extern void abort (); 27 28 int main(void)29main (void) 30 { 31 int i, j; 32 double res; 33 34 for (i = 0; i < 1782225; i++) 35 u[i] = 0; 36 u[0] = __DBL_MAX__; 37 u[1335] = -__DBL_MAX__; 38 u[1] = __DBL_MAX__; 39 u[1336] = -__DBL_MAX__; 40 41 foo (1335, &res); 42 43 #if DEBUG 44 fprintf (stderr, "res = %d \n", res); 45 #endif 46 47 if (res != 0.0) 48 abort (); 49 50 return 0; 51 } 52 53 /* { dg-final { scan-tree-dump-not "is interchanged" "linterchange"} } */ 54