-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
flang:openmpllvm:openmpirbuilderIssues related to problems in the llvm-project/lib/Frontend/OpenMP/OMPIRBuilder.cppIssues related to problems in the llvm-project/lib/Frontend/OpenMP/OMPIRBuilder.cpp
Description
Version of flang : 22.0.0(ea3dbb8b0061a7e44cba92b6e4e4486c4a416d65)/AArch64
In the attached program (sngtatm029_21.f90), when using double precision complex in a statement within ATOMIC WRITE construct, the execution result is incorrect.
The same issue also occurs with quadruple precision complex.
In the following cases, the execution result is correct.
- Do not specify the compilation option (
-fopenmp), or - Remove
ATOMIC WRITE construct, or - Change
double precisionorquadruple precisiontosingle precision, or - Change
complextorealorinteger
The following are the test program, Flang, Gfortran and ifx compilation/execution results.
sngtatm029_21.f90:
program main
complex(8)::c81
complex(8)::c82
c81=0
c82=0
write(6,*) "1 : c81 = ", c81
!$omp parallel
!$omp atomic write
c81=c82+(1.0_8,1.0_8)
!$omp end parallel
write(6,*) "2 : c81 = ", c81
end program main$ export OMP_NUM_THREADS=2; flang -fopenmp sngtatm029_21.f90; ./a.out
1 : c81 = (0.,0.)
2 : c81 = (1.,0.)
$
$ flang sngtatm029_21.f90; ./a.out
1 : c81 = (0.,0.)
2 : c81 = (1.,1.)
$
$ export OMP_NUM_THREADS=2; gfortran -fopenmp sngtatm029_21.f90; ./a.out
1 : c81 = (0.0000000000000000,0.0000000000000000)
2 : c81 = (1.0000000000000000,1.0000000000000000)
$
$ export OMP_NUM_THREADS=2; ifx -qopenmp sngtatm029_21.f90; ./a.out
1 : c81 = (0.000000000000000E+000,0.000000000000000E+000)
2 : c81 = (1.00000000000000,1.00000000000000)
$
Metadata
Metadata
Assignees
Labels
flang:openmpllvm:openmpirbuilderIssues related to problems in the llvm-project/lib/Frontend/OpenMP/OMPIRBuilder.cppIssues related to problems in the llvm-project/lib/Frontend/OpenMP/OMPIRBuilder.cpp
Type
Projects
Status
Done