Skip to content

[flang][OpenMP] Parallel region failure #106297

Closed
@psteinfeld

Description

@psteinfeld

Here's a test program:

program bug
  use omp_lib
  implicit none
  integer ivar
  real :: table(10)
  !$OMP PARALLEL NUM_THREADS(3) PRIVATE(table)
    table = 1
    !$OMP PARALLEL NUM_THREADS(3) SHARED(table)
      !$OMP DO LASTPRIVATE(table)
        do ivar=1,size(table)
          table(:ivar) = ivar*5
        end do
    !$OMP END PARALLEL
    if (any(table/=size(table)*5)) then
      stop 'fail 3'
    end if

  !$OMP END PARALLEL
  print *,'ok'
End Program

Here's my compilation command -- flang-new -g -fopenmp -fopenmp-version=31 bug.f90
When I execute the result, I get the output:

Fortran STOP: fail 3
Fortran STOP: fail 3

When I compile this with gfortran (gfortran -fopenmp bug.f90) or ifort (ifort -fopenmp -qopenmp-lib=compat bug.f90), I get the output:

 ok

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviormlir:openmp

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions