Crash while using OpenMP MAX intrinsic reduction when the reduction is implemented in the following way:
!$omp parallel !$omp do reduction(max:x) do i=1, 100 if (y(i) .gt. x) x = y(i) end do !$omp end do !$omp end parallel
Although it is benefitted to use MAX intrinsic in the loop, this is also supported as per the OpenMP specification. This patch fixes the crash in this case.
Please add a !CHECK-NOT omp.reduction here.