$ cat test.f90
program test
integer :: i
integer, dimension(1:5) :: a, b
a = 1
print *, a
!$omp parallel
!$omp do reduction(max: a) private (b)
do i = 1, 5
b = (/ i, i + 1, i + 2 , i + 3 , i + 4 /)
a = max(a, b)
end do
!$omp end do
!$omp end parallel
print *, a
end program
An assertion failure is hit. I will provide the source-level reproducer and the version information.
Assertion
Reproducer
Version
With the old flang-new (llvm-16.0.4), the following TODO message is output.