The following subroutine is compiled without error with /debug or /opt, but causes an ICE with /check, /undef and /checkmate, with Versions 6.35, 7.2 and 8.51 (for the last, also with /64 added).
subroutine get_sys_mat()
implicit none
integer :: i
type :: sys_ab
real, allocatable :: a(:)
end type
type (sys_ab) :: sys
complex, allocatable :: a_cplx(:)
allocate(sys%a(10))
do i=1,10
sys%a(i) = cmplx(2.5*i+3.3, -2.3)
end do
allocate (a_cplx(10))
a_cplx = sys%a
print *,a_cplx
deallocate (a_cplx,sys%a)
end subroutine get_sys_mat
This test code was pared down from a ~4,000 line source file with dependencies on a number of additional modules.