pgfortran segfault on nested derived types with default init

Dear PGI team,

I’d like to report a segfault that I see with PGI 17.10 (community edition) on the following code:

program test

   type t1
      integer, dimension(:), pointer :: list => null()
      integer :: c = 0, &
                 d, &
                 e = 1
   end type

   type t2
      type(t1) :: comp = t1(d=2)
   end type

end

Trying to compile this supposedly valid F03 code (which is swallowed alright by gfortran and ifort), I see the following:

$ pgfortran def_init.f90 
pgfortran-Fatal-/opt/pgi/linux86-64/17.10/bin/pgf902 TERMINATED by signal 11
Arguments to /opt/pgi/linux86-64/17.10/bin/pgf902
/opt/pgi/linux86-64/17.10/bin/pgf902 /tmp/pgfortranHgRcJlafMeOf.ilm -fn def_init.f90 -opt 1 -terse 1 -inform warn -x 51 0x20 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -tp nehalem -x 120 0x1000 -x 124 0x1400 -y 15 2 -x 57 0x3b0000 -x 58 0x48000000 -x 49 0x100 -x 120 0x200 -astype 0 -x 70 0x40000000 -x 164 0x800000 -x 124 1 -y 163 0xc0000000 -x 189 0x10 -y 189 0x4000000 -cmdline '+pgfortran def_init.f90 ' -asm /tmp/pgfortranbgRcdVF58JxF.s

Signal 11 is SIGSEGV. Similarly unhealthy things happen with flang, where I reported this already:

https://github.com/flang-compiler/flang/issues/370

This is a blocker for me, which keeps me from using the PGI compiler. I hope the segfault can be fixed in a future pgfortran version.

Cheers,
Janus

This has been logged as TPR 25358.

Since it crashes the compiler, I suspect it will have elevated
priority.

dave

Unfortunately this still does not seem to work with version 18.4 :(