Skip to content

[Flang][OpenMP] OpenMP directive DEFAULT (NONE) is set, but a compilation-time error occurs indicating that the variable does not specify data-sharing attribute. #110442

Closed
@ohno-fj

Description

@ohno-fj
Version of flang-new : 20.0.0(2603c8b23be06116bc61bda36fae05b81d906c3f)/AArch64

When building CP2K, the following error is detected.
OpenMP directive DEFAULT (NONE) is set, but a compilation-time error occurs indicating that the variable does not specify data-sharing attribute.

The following are a self-made reproducer, Flang-new compilation result.

z1.f90:

subroutine sub( aaa)
  real,dimension(*),intent(in)::aaa
  integer::ip
  real::ccc
!$omp parallel do private(ip,ccc) default(none)
  do ip = 1, 10
     ccc= aaa(ip)
  end do
end subroutine sub

program main
  real::arg(10)
  arg=1.0
  print *,'pass'
end program main
$ flang-new -fopenmp z1.f90
error: Semantic errors in z1.f90
./z1.f90:7:11: error: The DEFAULT(NONE) clause requires that 'aaa' must be listed in a data-sharing attribute clause
       ccc= aaa(ip)
            ^^^
$

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions