https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78009
janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code CC| |janus at gcc dot gnu.org Target Milestone|--- |7.0 --- Comment #2 from janus at gcc dot gnu.org --- Slightly simpler test case: program test type :: t integer :: a end type type, extends(t) :: tt integer :: b end type type :: group class(t), allocatable, dimension(:) :: unit end type type(group) :: g allocate(tt::g%unit(10)) g%unit(:)%a = 1 select type (units => g%unit) type is (tt) do i=1,10 write(*,*) units(i)%a, units(i)%b end do end select end program test Note: When removing the 'group' type and declaring 'unit' directly in the main program, the correct output is obtained.