Internal compiler error

The following code causes the compiler (PGI18.10-1 64 bit on x86_64 Linux) to segfault:

module funcdefs
  implicit none
contains

  function nrOfAtoms() result(nAtom)
    integer :: nAtom
    nAtom = 3
  end function nrOfAtoms

end module funcdefs


module dftbp_mmapi
  use funcdefs, only : nrOfAtoms
  implicit none

  type :: TDftbPlus
  contains
    procedure :: nrOfAtoms => TDftbPlus_nrOfAtoms
  end type TDftbPlus

contains

  function TDftbPlus_nrOfAtoms(this) result(nAtom)
    class(TDftbPlus), intent(in) :: this
    integer :: nAtom
    nAtom = nrOfAtoms()
  end function TDftbPlus_nrOfAtoms

end module dftbp_mmapi

Running

pgfortran -c test.f90

results in

PGF90-S-0000-Internal compiler error. memsym_of_ast:unexp.ast       1  (test.f90: 32)
  0 inform,   0 warnings,   1 severes, 0 fatal for tdftbplus_nrofatoms

Best regards, Bálint

Hi Bálint,

Thanks for the report! I was able to recreate the issue here using PGI 19.1 so added a problem report (TPR#26978) and sent it to our compiler engineers for further investigation.

Best Regards,
Mat