Specifying lbound with kind parameter for derived data type

Hello,

I’m having an issue with lbound. Consider the following example code:

program main
   use ISO_FORTRAN_ENV, only : INT32
   implicit none

   type :: mytype
      integer, dimension(:), allocatable :: a
   end type mytype
   type(mytype) :: t

   allocate(t%a(-25:400))

   write(*,*) lbound(t%a,KIND=INT32)        ! -- Bugged

end program main

I get the following compiler error with 15.5 and 14.3:

km-gs3% pgfortran --version

pgfortran 15.5-0 64-bit target on x86-64 Linux -tp piledriver 
The Portland Group - PGI Compilers and Tools
Copyright (c) 2015, NVIDIA CORPORATION.  All rights reserved.
km-gs3% pgfortran test_bounds.f90
/tmp/pgfortranpfmdTLpQqW1D.o: In function `main':
/home/project-chaud106/Testing/./test_bounds.f90:10: undefined reference to `pghpf_lbounda4'

Seems like a compiler bug to me. The issue only occurs when the array is a component of a derived data type. It’s also present for ubound.

Of course, I can simply use int to cast lbound as a kind of my choice:

   write(*,*) int(lbound(t%a),KIND=INT32)    ! -- Not bugged

But it would be nice if the bounds worked as expected.

Thanks for the report. We missed something when we changed from
references to pghpf_* to pgf90_*.

This has been filed as TPR 22011.

thanks,
dave

Thanks Dave.

Is there any way for users to see the progress of various problem reports, such as TPR 22011? When the issue is resolved, could we see which version of pgfortran first implements the fix?

TPR 22011 - lbound with a kind argument results in an undefined reference to `pghpf_lbounda4’

has been fixed in the current 15.10 release.

thanks,
dave