Issue 76121
Summary [OpenMP] [Flang] Program crashes at runtime with Segmentation fault when OMP PARALLEL DO IF(.false.) is encountered
Labels flang
Assignees chandankds
Reporter chandankds
    Testcase to reproduce the issue.

```
PROGRAM parallel_do_if
  USE OMP_LIB
  INTEGER :: I
  INTEGER :: N = 0
  INTEGER, PARAMETER :: NI = 10
!$OMP PARALLEL DO IF(.false.) 
  DO I = 1, NI
  END DO
!$OMP END PARALLEL DO
END PROGRAM
```
compile: flang-new -fopenmp ./test.f90 -o if.out
Run: ./if.out

Analysis: Segmentation fault is caused by null pointer dereference inside the __kmpc_fork_call_if function.

Triage: Issue introduced after https://github.com/llvm/llvm-project/pull/65436 . Testcase works as expected after removal of this patch.

Proposed Fix: Replace nullptr with struct of pointers to shared variables that aren't global

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

Reply via email to