pgfortran bug: default initialization of derived type

Dear all,

apparently the PGI Fortran compiler has a bug, when it meets a default initialisation expression for a real derived type component and the expression contains a user defined kind specification. The code below triggers an internal compiler error. When the_dp kind selector is left away, the ICE does not occur.

Best regards,


module bugtestmod
  implicit none

  integer, parameter :: dp = kind(1.0d0)

  type :: wrapper
    real(dp) :: tol = epsilon(1.0_dp)**0.25_dp
  end type wrapper

end module bugtestmod

Thanks baradi66259,

I added a problem report (TPR#22713) and sent it off to engineering. Looks like we’re missing support for fractional powers in a module data initialization statement. Note that the error occurs for me with or without the dp selector.

% cat bug2.f90
module bugtestmod
   real(8) :: tol = 1.0**0.25
end module bugtestmod
% pgfortran -c bug2.f90 -V16.7
PGF90-S-0155-Invalid initialization of kind type parameter tol (bug2.f90: 2)
PGF90-F-0000-Internal compiler error. dinit_intr_call: incorrect ACL type for intrinsic selector
       0 (bug2.f90: 2)
PGF90/x86-64 Linux 16.7-0: compilation aborted
  • Mat