https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67123
Bug ID: 67123 Summary: ICE with source allocation Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: mrestelli at gmail dot com Target Milestone: --- The following code produces an internal compiler error with gfortran-6.0.0 (works with 5.1.0): module m implicit none public type :: ta end type ta contains subroutine sub() type(ta), allocatable :: as(:) allocate( as(0) , source=f() ) end subroutine sub pure function f() result(res) type(ta), allocatable :: res(:) allocate(res(0)) end function f end module m $ gfortran -c ice-test.f90 ice-test.f90:12:0: allocate( as(0) , source=f() ) 1 internal compiler error: in gfc_conv_procedure_call, at fortran/trans-expr.c:5831 0x699752 gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*, gfc_expr*, vec<tree_node*, va_gc, vl_embed>*) gcc/fortran/trans-expr.c:5831 0x69987c gfc_conv_function_expr gcc/fortran/trans-expr.c:6516 0x69f5d8 gfc_conv_expr_reference(gfc_se*, gfc_expr*) gcc/fortran/trans-expr.c:7617 0x6cc8b2 gfc_trans_allocate(gfc_code*) gcc/fortran/trans-stmt.c:5195 0x66ac67 trans_code gcc/fortran/trans.c:1829 0x68dba3 gfc_generate_function_code(gfc_namespace*) gcc/fortran/trans-decl.c:5884 0x66e181 gfc_generate_module_code(gfc_namespace*) gcc/fortran/trans.c:2045 0x62776d translate_all_program_units gcc/fortran/parse.c:5508 0x62776d gfc_parse_file() gcc/fortran/parse.c:5726 0x668042 gfc_be_parse_file gcc/fortran/f95-lang.c:209