[llvm] [mlir] [mlir][OpenMP] Add __atomic_store to AtomicInfo (PR #121055)

Tom Eccles via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 09:04:02 PST 2025


tblah wrote:

Thanks for your work on this. I think there is some memory corruption going on for complex numbers of different kinds:
```
Program atomic_corruption
  Use omp_lib
  complex(8) :: x = 0
  ! problem goes away if this is turned into complex(8):
  complex v,v2
  v2 = 0
  !$omp parallel num_threads(1)
  if (real(v2)/=0.0) stop "v2 corrupted at 1"
  !$omp atomic read
    v = x
  if (real(v2)/=0.0) stop "v2 corrupted at 2"
  !$omp end parallel
end program
```
When I run this I hit the second stop "v2 corrupted at 2". The problem goes away when x and v have the same kind.

https://github.com/llvm/llvm-project/pull/121055


More information about the llvm-commits mailing list