Skip to content

[flang][openmp] Bad code for "private" directive with pointers and targets #102939

Open
@psteinfeld

Description

@psteinfeld

Here's a test program:

program bug
  integer, pointer :: pvar
  integer, target :: tvar
  tvar = 2
  pvar => tvar
  !$omp parallel private (pvar, tvar)
  tvar = 1
  pvar => tvar
  !$omp end parallel
  if (pvar/=2) stop 'fail'
  print *, 'ok'
end program

I compile this program with flang-new -fopenmp bug.f90. When I execute it, I get the output:

Fortran STOP: fail
IEEE arithmetic exceptions signaled: INEXACT

When I compile and execute the same program with gfortran -fopenmp bug.f90, I get the output:

ok

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviorflang:openmp

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions