https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112460
Bug ID: 112460 Summary: ICE with parameterized derived types (incorrect code, should be rejected) Product: gcc Version: 14.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: --- This is probably known (then it can be marked as duplicate), but let me report it nevertheless. The following code should be rejected, but leads to an ICE: 27 | print *, cc | 1 internal compiler error: Segmentation fault: 11 Reproducer: module color_propagator implicit none private public :: open_epsilon, closed_epsilon type :: open_epsilon integer, dimension(2) :: i end type open_epsilon type :: closed_epsilon integer, dimension(3) :: i end type closed_epsilon public :: t type :: t (n_in, n_out) integer, len :: n_in = 0, n_out = 0 logical :: is_ghost = .false. integer, dimension(n_in) :: in integer, dimension(n_out) :: out type(open_epsilon), dimension(:), allocatable :: open_eps, open_eps_bar type(closed_epsilon), dimension(:), allocatable :: closed_eps, closed_eps_bar end type t end module color_propagator program foo use color_propagator type(t(n_in=2,n_out=1)), save :: aa type(t(n_in=1,n_out=2)), save :: bb type(t), dimension(2), save :: cc cc = [aa, bb] print *, cc end program foo