https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128476
--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> --- Created attachment 66166 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=66166&action=edit Testcase – with runtime issues The attached testcase compiles with that fix – and in terms of private/firstprivate seems to work fine. However, value testing shows that 448 of the 864 values are wrong (have the initial value). It seems the problem is that gimplification turns (original dump's) #pragma omp teams private(j3) firstprivate(n) firstprivate(m) #pragma omp loop collapse(2) into #pragma omp teams private(j3) shared(j2) shared(j) #pragma omp distribute bind(teams) lastprivate(j2) lastprivate(j) collapse(2) #pragma omp parallel shared(j3) lastprivate(j2) lastprivate(j) #pragma omp for bind(teams) order(concurrent) collapse(2) #pragma omp simd lastprivate(j2) lastprivate(j) bind(teams) order(concurrent) collapse(2) It seems as if the 'shared(j3)' should be 'private(j3)' on 'parallel'.
