Fortran use only Internal compiler Error

I’m trying to compile a fairly complex program using pgf90 19.4-0 LLVM on 64 bit linux.

I’ve tracked down a serve compiler bug related to use, only in modules. The smallest example to replicate the problem is below:

file 1: strDict.F90

module utilsMod
  implicit none
  interface

     module subroutine convertToLowerCase(string)
       character (len=*), intent(inout) :: string
     end subroutine convertToLowerCase

  end interface

contains
end module utilsMod

module strDictMod

  use utilsMod, only : convertToLowerCase    ! <-------- This is the error
  implicit none

  private
  public strDict

  type strDict
   contains
     procedure :: create
  end type strDict

contains

  subroutine create(d, str)

    class(StrDict) :: d
    character(len=*) :: str
    call convertToLowerCase(str)
  end subroutine create

end module strDictMod

file 2: hashTable.F90

module hashTableMod
  use strDictMod
  implicit none
end module hashTableMod

To Replicate:

pgf90 -c -fPIC strDict.F90
pgf90 -c -fPIC hasTable.F90

gives:

PGF90-F-0000-Internal compiler error. interf:new_symbol, symbol not found     625  (hashTable.F90: 4)
PGF90/x86-64 Linux 19.4-0: compilation aborted

I’ve determined a work-around, the import "use utilsMod, only : convertToLowerCase " can’t be at the top of the module. It can be in the individual routine. Someone most likely coded this incorrectly in the compiler. I’m 99% sure this is standard conforming as other popular fortran compilers do not have any issues.

Thanks,
Gaetan

Thanks Gaetan.

I’ve reproduced the issue here and reported it to our compiler engineers (as TPR #28073) for further investigation.

Note, another work around is to remove “only : convertToLowerCase” and instead just have “use utilsMod”.

Best Regards,
Mat