https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106242
Bug ID: 106242 Summary: Internal compiler error: Parameterised derived types Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: kidon at posteo dot de Target Milestone: --- The following example code implements nested parameterised derived types: module test type :: foo_type(n) integer, len :: n character(len=n) :: s end type foo_type type :: bar_type(n) integer, len :: n type(foo_type(n=n)) :: foo end type bar_type contains subroutine set_bar(bar, s) type(bar_type(n=*)), intent(inout) :: bar character(len=*), intent(in) :: s bar%foo%s = s end subroutine set_bar end module test program main use :: test type(bar_type(n=10)) :: bar call set_bar(bar, 'foo') end program main Trying to build the example with GNU Fortran 12.1 on FreeBSD 13.1 results in an internal compiler error: $ gfortran -freport-bug -o test test.f90 f951: internal compiler error: Segmentation fault 0x19d832f internal_error(char const*, ...) ???:0 0x69e4b5 gfc_traverse_expr(gfc_expr*, gfc_symbol*, bool (*)(gfc_expr*, gfc_symbol*, int*), int) ???:0 0x68b2e2 gfc_get_pdt_instance(gfc_actual_arglist*, gfc_symbol**, gfc_actual_arglist**) ???:0 0x6966dc gfc_match_decl_type_spec(gfc_typespec*, int) ???:0 0x74455d gfc_parse_file() ???:0 Please submit a full bug report, with preprocessed source.