Skip to content

[flang][openmp] Bad code for "private" clause and named common #102949

Open
@psteinfeld

Description

@psteinfeld

Here's a reproducer:

Program bug
  Real :: x
  Common /named_common/ x
  x = 1.0
  Call sub()
  If (x/=1.0) Then
    Print *,'FAIL common, x: ',x
  Else
    Print *,'ok'
  End If
contains
  Subroutine sub
    Real :: x
    Common /named_common/ x
    !$OMP PARALLEL PRIVATE (/named_common/)
      x = 2.0
    !$OMP END PARALLEL
  End Subroutine
End Program

If I compile and execute this program with the -fopenmp option, I get the output:

 FAIL common, x:  2.

Alternatively, gfortran produces the output:

 ok

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions