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

            Bug ID: 63844
           Summary: open mp parallelization prevents vectorization
           Product: gcc
           Version: 4.9.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andi-gcc at firstfloor dot org

#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];
        }
}


compiled with gcc -O3 -fopenmp

The first loop gets parallelized by openmp, the second loop gets vectorized.
But why does the parallelized loop not get vectorized too?

Reply via email to