PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr83857.c
blobf90f5d43a8d75bd953245990bd1c28f6382e5873
1 /* { dg-additional-options "-ffast-math" } */
3 #define N 100
5 double __attribute__ ((noinline, noclone))
6 f (double *x, double y)
8 double a = 0;
9 for (int i = 0; i < N; ++i)
11 a += y;
12 x[i * 2] += a;
13 x[i * 2 + 1] += a;
15 return a - y;
18 double x[N * 2];
20 int
21 main (void)
23 if (f (x, 5) != (N - 1) * 5)
24 __builtin_abort ();
25 return 0;
28 /* { dg-final { scan-tree-dump "Loop contains only SLP stmts" "vect" { target vect_double } } } */
29 /* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target vect_double } } } */