https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85981
Bug ID: 85981 Summary: ICE in gfc_trans_string_copy, at fortran/trans-expr.c:6539 Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: gs...@t-online.de Target Milestone: --- Down to at least 4.8 : $ cat z1.f90 program p integer, allocatable :: arr(:) integer :: stat character(len=128, kind=4) :: errmsg = ' ' allocate (arr(3), stat=stat, errmsg=errmsg) print *, allocated(arr), stat, trim(errmsg) end $ gfortran-9-20180527 -c z1.f90 z1.f90:5:0: allocate (arr(3), stat=stat, errmsg=errmsg) internal compiler error: in gfc_trans_string_copy, at fortran/trans-expr.c:6539 0x7782cf gfc_trans_string_copy(stmtblock_t*, tree_node*, tree_node*, int, tree_node*, tree_node*, int) ../../gcc/fortran/trans-expr.c:6539 0x7bb884 gfc_trans_allocate(gfc_code*) ../../gcc/fortran/trans-stmt.c:6708 0x74acf7 trans_code ../../gcc/fortran/trans.c:1996 0x772269 gfc_generate_function_code(gfc_namespace*) ../../gcc/fortran/trans-decl.c:6507 0x701040 translate_all_program_units ../../gcc/fortran/parse.c:6121 0x701040 gfc_parse_file() ../../gcc/fortran/parse.c:6324 0x7480ef gfc_be_parse_file ../../gcc/fortran/f95-lang.c:204