| Issue |
181271
|
| Summary |
[Flang][OpenMP] Execution terminates abnormally when TASK construct containing FIRSTPRIVATE clause exists within PARALLEL construct
|
| Labels |
flang:openmp
|
| Assignees |
|
| Reporter |
ohno-fj
|
```
Version of flang : 23.0.0(a563e6bb7ed485e0ab88717bb4a8c5e8522d9792)/AArch64
```
In the attached program (`snfm_task_014_2.f90`), when `TASK construct` containing `FIRSTPRIVATE clause` exists within `PARALLEL construct`, the execution terminates abnormally.
The execution terminates normally in the following cases:
- Enabling the assignment statement (`b=3`), or
The above is `snfm_task_014_21.f90`.
- Remove `PARALLEL construct`, or
The above is `snfm_task_014_22.f90`.
- Remove `TASK construct`
The above is `snfm_task_014_23.f90`.
The following are the test program, Flang, Gfortran and ifx compilation/execution results.
snfm_task_014_2.f90:
```fortran
program main
integer::b(2)
b=1
!$omp parallel private(b)
b=2
!$omp task
!$omp task firstprivate(b)
! b=3
!$omp endtask
!$omp endtask
!$omp end parallel
print *,"pass"
end program main
```
```
$ export OMP_NUM_THREADS=2; flang -fopenmp snfm_task_014_2.f90; ./a.out
fatal Fortran runtime error(/work/test/snfm_task_014_2.f90:2): Assign: mismatching types (to code 9 != from code 64)
fatal Fortran runtime error(/work/test/snfm_task_014_2.f90:2)Aborted (core dumped)
$
```
```
$ export OMP_NUM_THREADS=2; gfortran -fopenmp snfm_task_014_2.f90; ./a.out
pass
$
```
```
$ export OMP_NUM_THREADS=2; ifx -qopenmp snfm_task_014_2.f90; ./a.out
pass
$
```
snfm_task_014_21.f90:
```fortran
program main
integer::b(2)
b=1
!$omp parallel private(b)
b=2
!$omp task
!$omp task firstprivate(b)
b=3
!$omp endtask
!$omp endtask
!$omp end parallel
print *,"pass"
end program main
```
```
$ export OMP_NUM_THREADS=2; flang -fopenmp snfm_task_014_21.f90; ./a.out
pass
$
```
snfm_task_014_22.f90:
```fortran
program main
integer::b(2)
b=1
!$omp parallel private(b)
b=2
! !$omp task
!$omp task firstprivate(b)
! b=3
!$omp endtask
! !$omp endtask
!$omp end parallel
print *,"pass"
end program main
```
```
$ export OMP_NUM_THREADS=2; flang -fopenmp snfm_task_014_22.f90; ./a.out
pass
$
```
snfm_task_014_23.f90:
```fortran
program main
integer::b(2)
b=1
! !$omp parallel private(b)
b=2
!$omp task
!$omp task firstprivate(b)
! b=3
!$omp endtask
!$omp endtask
! !$omp end parallel
print *,"pass"
end program main
```
```
$ export OMP_NUM_THREADS=2; flang -fopenmp snfm_task_014_23.f90; ./a.out
pass
$
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs