Skip to content

[Flang] [OpenMP] Execution error when derived type with nested definitions is specified in private clause of parallel construct #114888

@ohno-fj

Description

@ohno-fj
Version of flang-new : 20.0.0(5621929f7f4878c318deecb592cd03f5ecbb83ba)/AArch64

When derived type with nested definitions is specified in a private clause of parallel construct, segmentation fault (core dumped) occurs.
The above statement is (2) in the program.
Terminates normally if not nested.
The above statement is (1) in the program.

The following are the test program, Flang-new, Gfortran and ifx compilation/execution result.

sngg188a_2.f90:

module m1
  type y
     integer:: y1=2
  end type y
  type x
     integer:: x1=1
     type(y),allocatable:: x2(:)
  end type x
end module m1

subroutine s1
  use m1
  type(x):: v1
  allocate( v1%x2(2:3))
  v1%x2(2:3)%y1=[2,3]
!$omp parallel private( v1 )
  v1%x1=2          ! (1)
  v1%x2%y1=-1      ! (2)
!$omp end parallel
end subroutine s1

program main
  call s1
  print *,'pass'
end program main
$ export OMP_NUM_THREADS=2; flang-new -fopenmp sngg188a_2.f90; ./a.out
flang-20: warning: OpenMP support in flang is still experimental [-Wexperimental-option]
Segmentation fault (core dumped)
$
$ export OMP_NUM_THREADS=2; gfortran -fopenmp sngg188a_2.f90; ./a.out
 pass
$
$ export OMP_NUM_THREADS=2; ifx -qopenmp sngg188a_2.f90; ./a.out
 pass
$

Metadata

Metadata

Assignees

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions