https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71936
--- Comment #1 from Gerhard Steinmetz <gerhard.steinmetz.fort...@t-online.de> --- These other two cases produce an related ICE : $ cat z3.f90 program p type t end type class(t), pointer :: x(:) allocate (x, mold=f()) deallocate (x) allocate (x, source=f()) contains function f() class(t), allocatable :: f(:) end end $ cat z4.f90 program p type t end type class(t), pointer :: x(:) allocate (x, mold=f()) deallocate (x) allocate (x, source=f()) contains function f() class(t), pointer :: f(:) end end $ gfortran-7-20160717 z4.f90 z4.f90:5:0: allocate (x, mold=f()) internal compiler error: in fold_convert_loc, at fold-const.c:2370 0x943a0c fold_convert_loc(unsigned int, tree_node*, tree_node*) ../../gcc/fold-const.c:2370 0x71f6a4 gfc_allocate_using_malloc(stmtblock_t*, tree_node*, tree_node*, tree_node*) ../../gcc/fortran/trans.c:663 0x7a0b70 gfc_trans_allocate(gfc_code*) ../../gcc/fortran/trans-stmt.c:5878 0x71c407 trans_code ../../gcc/fortran/trans.c:1838 0x74b218 gfc_generate_function_code(gfc_namespace*) ../../gcc/fortran/trans-decl.c:6207 0x6d6cc0 translate_all_program_units ../../gcc/fortran/parse.c:5916 0x6d6cc0 gfc_parse_file() ../../gcc/fortran/parse.c:6122 0x719192 gfc_be_parse_file ../../gcc/fortran/f95-lang.c:198