-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[Flang][OpenMP] Incorrect execution result of a do-variable in critical construct which exists in parallel construct with default(none) clause #78936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-openmp Author: None (ohno-fj)
```
Version of flang-new : 18.0.0(0fe86f9)
```
If 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,10
do k1=1,10
end do
end do
!$omp end critical
!$omp endparallel
write(6,*) "k1 = ", k1, " k2 = ", k2
end program main
|
This is similar to #75767. |
@llvm/issue-subscribers-flang-frontend Author: None (ohno-fj)
```
Version of flang-new : 18.0.0(0fe86f9)
```
If 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,10
do k1=1,10
end do
end do
!$omp end critical
!$omp endparallel
write(6,*) "k1 = ", k1, " k2 = ", k2
end program main
|
If
critical
construct exists inparallel
construct withdefault(none)
clause, ado-variable
has an incorrect value after executingparallel
construct.A
do-variable
isprivate
according to the specification inSection (2.15.1.1) of OpenMP 4.5
, so the values of k1 and k2 are expected to be 1.Changing
critical
construct tosections
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:
The text was updated successfully, but these errors were encountered: