Skip to content

[flang] [OpenMP] Flang inline directive regression #165874

@scamp-nvidia

Description

@scamp-nvidia

There is a new regression with Flang OpenMP inline directive handling. We have narrowed it down to occurring between 22079e3 and 9a51879. Consider the following test.F90 code with inline OpenMP directives:

subroutine kern_xx(NA, BLK, NSP, OUT, A1, A2)
  implicit none
  integer :: NA, BLK, NSP
  integer :: M, MM
  real(8) :: OUT(NA)
  complex(8) :: A1(BLK*NSP), A2(BLK*NSP)

!$OMP       PARALLEL SHARED(NSP,OUT,A1,A2) !$OMP PRIVATE(M,MM)
!$OMP       END PARALLEL
end subroutine kern_xx

Compiling this with Flang before 22079e3 generates everything okay, but after 9a51879 we get the following error:

scamp$ flang test.F90 -c -fopenmp
error: Could not parse test.F90
./test.F90:8:50: error: expected 'END'
  !$OMP       PARALLEL SHARED(NSP,OUT,A1,A2) !$OMP PRIVATE(M,MM)
                                                   ^
./test.F90:8:44: in the context: execution part construct
  !$OMP       PARALLEL SHARED(NSP,OUT,A1,A2) !$OMP PRIVATE(M,MM)
                                             ^
./test.F90:8:1: in the context: OpenMP construct
  !$OMP       PARALLEL SHARED(NSP,OUT,A1,A2) !$OMP PRIVATE(M,MM)
  ^

The same code compiled with GCC and NVHPC works perfectly fine - and like I said, before the given hash range, Flang handled it fine. Looking at the commit range, I'm very suspicious of 9a51879 causing the regression since it altered how some inline directives are handled - tagging @Meinersbur and @EbinJose2002 for a check over, since they worked on the suspicious issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions