Problem with a statement function using a derived type variable and OpenMP

Hi

The following code :

$ cat suehdf.F90 
SUBROUTINE SUEHDF

IMPLICIT NONE

TYPE TT
  REAL*8 :: FRANDH
END TYPE

TYPE (TT) :: YDDYN

REAL(KIND=8) :: RDIVORE(100)

INTEGER(KIND=4) :: JLEV

REAL(KIND=8) :: BDISPE
INTEGER(KIND=4) :: KM

BDISPE(KM)=REAL (KM, 8) + YDDYN%FRANDH

!$OMP PARALLEL DO PRIVATE(JLEV)
    DO JLEV=1,100
      RDIVORE(JLEV)=BDISPE(JLEV)
    ENDDO 
!$OMP END PARALLEL DO

END SUBROUTINE SUEHDF

does not compile :

$ pgf90 -c -mp -O0 -g suehdf.F90
/opt/softs/nvidia/hpc_sdk/Linux_x86_64/21.7/compilers/share/llvm/bin/llc: error: /opt/softs/nvidia/hpc_sdk/Linux_x86_64/21.7/compilers/share/llvm/bin/llc: /scratch/utmp/marguina/nvfortran749wXFTuvIC4.ll:122:16: error: use of undefined type named 'struct.BSS1'
        %31 = bitcast %struct.BSS1* @.BSS1 to double*, !dbg !51

Compiling with -mp works.

$ pgf90 --version

pgf90 (aka nvfortran) 21.7-0 64-bit target on x86-64 Linux -tp zen 
PGI Compilers and Tools
Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES.  All rights reserved.

$ cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.8 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.8"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.8 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.8:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.8
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.8"

Regards,

Philippe

Thanks for the bug report, and small reproducer. I was able to get the same behavior as you. I opened FS#30572 to track this bug.