Issue 152123
Summary [Flang][OpenMP] compilation failed when combining firstprivate/lastprivate with a loop containing !$omp cancel do
Labels flang:openmp
Assignees
Reporter k-arrows
    Reproducer:
https://godbolt.org/z/6xdvvceM5
```f90
integer :: i, j
!$omp parallel
!$omp do firstprivate(j) lastprivate(j)
do i=1, 2
!$omp cancel do
end do
!$omp end do
!$omp end parallel
end
```

With assertion-enabled flang, compiling the above reproducer results in the following UNREACHABLE execution:
```txt
Basic Block in function '_QQmain' does not have terminator!
label %omp.private.copy.cont
Terminator found in the middle of a basic block!
label %omp.private.copy
While deleting: label %omp.private.copy.cont
Use still stuck around after Def is destroyed:  br i1 %4, label %omp.private.copy.cont, label %omp.private.copy.cncl
Uses remain when a value is destroyed!
UNREACHABLE executed at /path_to_project/llvm-project/llvm/lib/IR/Value.cpp:102!
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to