PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-outer-6.c
blob201ca8424828d6dabe1c6d90dff8396438a71ff4
1 /* { dg-require-effective-target vect_float } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 64
7 #define MAX 42
9 float A[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
10 float B[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
11 float C[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
12 float D[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
13 extern void abort(void);
15 __attribute__ ((noinline))
16 int main1 ()
18 float s;
20 int i, j;
22 for (i = 0; i < N; i++)
24 s = 0;
25 for (j = 0; j < N; j += 4)
26 s += C[j];
27 A[i] = s;
30 return 0;
33 int main ()
35 int i,j;
36 float s;
38 check_vect ();
40 for (i = 0; i < N; i++)
42 A[i] = i;
43 B[i] = i;
44 C[i] = i;
45 D[i] = i;
48 main1();
50 /* check results: */
51 for (i = 0; i < N; i++)
53 s = 0;
54 for (j = 0; j < N; j += 4)
55 s += C[j];
56 if (A[i] != s)
57 abort ();
60 return 0;
63 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
64 /* { dg-final { scan-tree-dump-times "zero step in outer loop." 1 "vect" } } */