Issue |
91928
|
Summary |
[Flang][OpenMP] Compilation error when lastprivate clause specified in do construct has a derived type with an allocatable variable
|
Labels |
openmp,
flang
|
Assignees |
|
Reporter |
ohno-fj
|
```
Version of flang-new : 19.0.0(1a498103ee5c4d101e70dc49db11938d8b87b518)/AArch64
```
When `lastprivate` clause specified in `do` construct has a `derived type` with an allocatable variable, a compilation terminates abnormally.
When `lastprivate` clause in `do` construct is removed, a compilation terminates normally.
The following are the test program, Flang-new, Gfortran and ifort compilation/execution result.
lp10_32.f90:
```fortran
subroutine s4
type y3
integer,allocatable::x
end type y3
type(y3)::v
allocate(v%x)
v%x=0
!$omp parallel
if (.not. allocated(v%x)) print *,'101'
!$omp do lastprivate(v)
do i=1,10
v%x=i
end do
!$omp end do
!$omp end parallel
end subroutine s4
program main
call s4
print *,'pass'
end program main
```
```
$ export OMP_NUM_THREADS=2; flang-new -fopenmp lp10_32.f90; ./a.out
fatal Fortran runtime error(/work/home/ohno/CT/test/fort/tp/reproducerJ/fomp_omp40/lp10_32.f90:12): Assign: mismatching types (to code 64 != from code 9)
fatal Fortran runtime error(/work/home/ohno/CT/test/fort/tp/reproducerJ/fomp_omp40/lp10_32.f90:12): Assign: mismatching types (to code 64 != from code 9)
Aborted (core dumped)
$
```
```
$ export OMP_NUM_THREADS=2; gfortran -fopenmp lp10_32.f90; ./a.out
pass
$
```
```
$ export OMP_NUM_THREADS=2; ifort -qopenmp -diag-disable=10448 lp10_32.f90; ./a.out
pass
$
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs