https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63844

--- Comment #4 from Andi Kleen <andi-gcc at firstfloor dot org> ---
I had a typo in the test case (remove += to make the loops identical)

#define N 10000000
int a[N], b[N], c[N];

main()
{

        int i;

#pragma omp parallel num_threads(4)
        for (i = 0; i < N; i++) {
                a[i] = b[i] + c[i];
        }
        for (i = 0; i < N; i++) {
                a[i] = b[i] + c[i];
        }
}

The case I saw vectorized on 4.8 (opensuse 13.1 compiler), but not on 5.0, was
slightly different, auto parallelized

#define N 10000000
int a[N], b[N], c[N];

main()
{

        int i;
        for (i = 0; i < N; i++) {
                a[i] = b[i] + c[i];
        }
}
With -O3 -mtree-parallelize-loops=4
I understand this will just internally generate openmp

Reply via email to