Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / gomp / pr68128-1.c
blob01cc605ae0e7581a1c5e448f58fc9b37f7f40a92
1 /* PR tree-optimization/68128 */
2 /* { dg-do compile } */
3 /* { dg-options "-Ofast -fopenmp -fdump-tree-vect-details" } */
4 /* { dg-additional-options "-mavx" { target i?86-*-* x86_64-*-* } } */
6 /* Make sure the following loop is vectorized even when not using
7 firstprivate variables for scalar vars that are not modified
8 in the parallel region. */
10 void
11 foo (float *u, float v, float w, float x, float y, float z, float t)
13 int i, j, k, l;
14 float a, *b, c, s, e;
15 #pragma omp parallel for private (i, j, k, l, a, b, c, s, e)
16 for (j = 0; j < 1024; j++)
18 k = j * 64;
19 l = j * 64 + 63;
20 a = v + j * w;
21 b = u + j * 64;
22 for (i = k; i <= l; i++, b++, a += w)
24 c = a * a + y;
25 s = (1.f - c * x) * (1.f - c * x);
26 e = t * (1 / __builtin_sqrtf (c)) * s;
27 *b += (c < z ? e : 0);
32 /* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" { target i?86-*-* x86_64-*-* } } } */