https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86052
Bug ID: 86052 Summary: ICE with parameterized derived types Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: juergen.reuter at desy dot de Target Milestone: --- The following example from c.l.f. (Dec 14, 2015, "explicit specialization for Fortran2003 recursively-defined parameterized data types?" leads to an ICE with the current trunk of gfortran (r260633). In the code below, if the non-pointer declaration is commented in, gfortran correctly vetoes this as "Component at (1) must have the POINTER attribute", but with the version below this leads to an ICE. With ifort v18 and v19 the code is rejected as "error #7555: Not yet implemented: Type containing ALLOCATABLE/POINTER field of same type with different type parameters. type(tensor(rank-1,dim)), pointer :: values(:)" ***** Code triggering the ICE: module tensor_names implicit none private type :: tensor(rank,dim) integer, kind :: rank integer, kind :: dim type(tensor(rank-1,dim)), pointer :: values(:) ! type(tensor(rank-1,dim)) :: values(dim) ! Illegal!!! contains procedure, private :: create_tensor_rank_2_dim_2 generic :: create => create_tensor_rank_2_dim_2 end type contains subroutine create_tensor_rank_2_dim_2 ( this ) implicit none class(tensor(2,2)), intent(inout) :: this end subroutine end module tensor_names