| Issue |
63828
|
| Summary |
[Flang][OpenMP] Unexpected warning emitted for a FORALL construct
|
| Labels |
|
| Assignees |
|
| Reporter |
rofirrim
|
When compiling the following testcase with OpenMP enabled
```fortran
! t.f90
subroutine p(n, k)
implicit none
integer :: i
integer :: j
integer :: n
integer :: k(10, 10)
!$omp task private(i, j)
forall(i=1:10, j=1:10) k(i, j) = 0
!$omp end task
end subroutine p
```
the following diagnostics are emitted
```
$ flang-new -c t.f90 -fopenmp
./t.f90:10:25: warning: FORALL index variable 'i' not used on left-hand side of assignment
forall(i=1:10, j=1:10) k(i, j) = 0
^^^^^^^^^^^
./t.f90:10:25: warning: FORALL index variable 'j' not used on left-hand side of assignment
forall(i=1:10, j=1:10) k(i, j) = 0
^^^^^^^^^^^
```
but the variables are indeed used.
The diagnostic is not emitted if OpenMP is not enabled.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs