You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version of flang-new : 18.0.0(0fe86f9c518fb1296bba8d66ce495f9dfff2c435)
If critical construct exists in parallel construct with default(none) clause, a do-variable has an incorrect value after executing parallel construct.
A do-variable is private according to the specification in Section (2.15.1.1) of OpenMP 4.5, so the values of k1 and k2 are expected to be 1.
Changing critical construct to sections construct has the same result.
The following are the test program, Flang-new, Gfortran and ifort compilation/execution result.
snfm_omp_array_do_011.f90:
program main
integer::k1,k2
k1=1; k2=1
!$omp parallel default(none)
!$omp critical
do k2=1,10do k1=1,10end doend do
!$omp end critical
!$omp endparallel
write(6,*) "k1 = ", k1, " k2 = ", k2
end program main