MRE:
program main
integer, parameter :: V = 2048
real(8) :: x(V), y(V)
x = 100.0
y = 200.0
print *, cgdot(x, y, V)
contains
function cgdot (x,y,N)
integer :: N, i
real(8) :: cgdot
real(8), dimension(N) :: x, y
cgdot=0.
do concurrent(i=1:N)
cgdot=cgdot+x(i)*y(i)
enddo
return
end
end program
Problem:
$ flang -fopenmp -fdo-concurrent-to-openmp=host x.f90
$ ./a.out
35780000.
Correct result
$ flang -fopenmp -fdo-concurrent-to-openmp=none x.f90
$ ./a.out
40960000.