Issue 161529
Summary [flang][openmp] Incorrect perfect nest detection if using continues instead of enddo.
Labels flang
Assignees
Reporter scamp-nvidia
    Consider the following example, carved down from an OpenMP SPEC test: 
```
! omp_compile_test.f90
program omp_compile_test
  implicit none
  integer, parameter :: N = 8
  real(8) :: PN(N,N) = 1.0d0, UN(N,N) = 2.0d0, VN(N,N) = 3.0d0
  real(8) :: P = 0.0d0, U = 0.0d0, V = 0.0d0
  integer :: i, j

!$omp target teams map(to:PN,UN,VN) map(tofrom:P,U,V)
!$omp loop collapse(2) reduction(+:P,U,V)
  do 4500 j = 1, N
    do 3500 i = 1, N
 P = P + abs(PN(i,j))
      U = U + abs(UN(i,j))
      V = V + abs(VN(i,j))
    3500 CONTINUE
   4500 CONTINUE
!$omp end target teams
end program
```

This has prevously worked, but began failing between d96c32cdaf588903917a9e7db172729759e34c9d and fad2a4c00db68ee10b506b05531cdc6458d9be37 with the following message: 

```
scamp$ flang test.F90 -fopenmp -o test
error: Semantic errors in test.F90
./test.F90:10:7: error: Canonical loop nest must be perfectly nested.
  !$omp loop collapse(2) reduction(+:P,U,V)
 ^^^^
```
Reading the changes between those two hashes, I immediately key in on #160283 - which appears to work on perfectly nested OpenMP Flang structures. Tagging @Meinersbur for investigation, please. 


_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to