Disable gather/scatter for non-first vectorized epilogue
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / loop-interchange-1.c
blobc7ebaefeab8afe204c505fb06e6b6f44138ed6bf
1 /* { dg-do run } */
2 /* { dg-options "-O2 -floop-interchange -fassociative-math -fno-signed-zeros -fno-trapping-math -fdump-tree-linterchange-details" } */
3 /* { dg-require-effective-target size32plus } */
4 /* { dg-skip-if "too big data segment" { visium-*-* } } */
6 /* Copied from graphite/interchange-4.c */
8 #define DEBUG 0
9 #if DEBUG
10 #include <stdio.h>
11 #endif
13 double u[1782225];
15 static int __attribute__((noinline))
16 foo (int N, int *res)
18 int i, j;
19 double sum = 0;
20 for (i = 0; i < N; i++)
21 for (j = 0; j < N; j++)
22 sum = sum + u[i + 1335 * j];
24 for (i = 0; i < N; i++)
25 u[1336 * i] *= 2;
27 *res = sum + N + u[1336 * 2] + u[1336];
30 extern void abort ();
32 int
33 main (void)
35 int i, j, res;
37 for (i = 0; i < 1782225; i++)
38 u[i] = 2;
40 foo (1335, &res);
42 #if DEBUG
43 fprintf (stderr, "res = %d \n", res);
44 #endif
46 if (res != 3565793)
47 abort ();
49 return 0;
52 /* { dg-final { scan-tree-dump-times "Loop_pair<outer:., inner:.> is interchanged" 1 "linterchange"} } */