llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[flang][OpenMP] Diagnose invalid reduction modifiers

Open kparzysz opened this issue 2 years ago • 2 comments

Currently the flang frontend will accept the following code. The task modifier on the reduction clause is only valid for certain constructs, and simd is not one of them.

subroutine fred(x)
  integer, intent(inout) :: x

  !$omp simd reduction(task, +:x)
  do i = 1, 100
    x = foo(i)
  enddo
  !$omp end simd
end

kparzysz avatar May 16 '24 13:05 kparzysz

@llvm/issue-subscribers-openmp

Author: Krzysztof Parzyszek (kparzysz)

Currently the flang frontend will accept the following code. The `task` modifier on the `reduction` clause is only valid for certain constructs, and `simd` is not one of them.
subroutine fred(x)
  integer, intent(inout) :: x

  !$omp simd reduction(task, +:x)
  do i = 1, 100
    x = foo(i)
  enddo
  !$omp end simd
end

llvmbot avatar May 16 '24 13:05 llvmbot

@llvm/issue-subscribers-flang-frontend

Author: Krzysztof Parzyszek (kparzysz)

Currently the flang frontend will accept the following code. The `task` modifier on the `reduction` clause is only valid for certain constructs, and `simd` is not one of them.
subroutine fred(x)
  integer, intent(inout) :: x

  !$omp simd reduction(task, +:x)
  do i = 1, 100
    x = foo(i)
  enddo
  !$omp end simd
end

llvmbot avatar May 16 '24 14:05 llvmbot