module mod1 type t1 real :: f1 end type t1 type t2 type(t1), pointer :: f2(:) real, pointer :: f3(:,:) end type t2 end module mod1
module mod2 use mod1 type(t1), pointer, save :: v(:) contains subroutine foo (x) use mod1 implicit none type(t2) :: x integer :: d d = size (x%f3, 2) v = x%f2(:) end subroutine foo end module mod2 ICEs in fold_convert, because gfortran created two distinct t1 types, one for the v variable and a different one for x. I'd say either gfortran should cache somewhere module derived type tree nodes and reuse them, or it needs a non-default type comparison hook that would figure which derived types are in fact compatible. -- Summary: Module derived type issue Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jakub at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25391