https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58331
--- Comment #7 from anlauf at gcc dot gnu.org --- Created attachment 54627 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54627&action=edit Latest patch This patch fixes the testcases in this PR. I tried other testcases that use coarrays, but e.g. the following scalar coarray case produces an ICE later on. I believe this is a pre-existing separate issue. program p implicit none integer :: ca[*] ca = 2 call sub_ca(ca) contains subroutine sub_ca (a) class(*), intent(in) :: a[*] end end pr58331-ca.f90:8:17: 8 | call sub_ca(ca) | 1 internal compiler error: in fold_convert_loc, at fold-const.cc:2627 0x726047 fold_convert_loc(unsigned int, tree_node*, tree_node*) ../../gcc-trunk/gcc/fold-const.cc:2627 0xa5edd2 gfc_conv_intrinsic_to_class(gfc_se*, gfc_expr*, gfc_typespec) ../../gcc-trunk/gcc/fortran/trans-expr.cc:1040 0xa70271 gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*, gfc_expr*, vec<tree_node*, va_gc, vl_embed>*) ../../gcc-trunk/gcc/fortran/trans-expr.cc:6239 0xadef24 gfc_trans_call(gfc_code*, bool, tree_node*, tree_node*, bool) ../../gcc-trunk/gcc/fortran/trans-stmt.cc:424 0xa0f555 trans_code ../../gcc-trunk/gcc/fortran/trans.cc:2018 0xa0fa1a gfc_trans_code(gfc_code*) ../../gcc-trunk/gcc/fortran/trans.cc:2303 0xa586b0 gfc_generate_function_code(gfc_namespace*) ../../gcc-trunk/gcc/fortran/trans-decl.cc:7704 0xa0fa5e gfc_generate_code(gfc_namespace*) ../../gcc-trunk/gcc/fortran/trans.cc:2320 0x9a5de6 translate_all_program_units ../../gcc-trunk/gcc/fortran/parse.cc:6720 0x9a66e8 gfc_parse_file() ../../gcc-trunk/gcc/fortran/parse.cc:7026 0x9f6d5e gfc_be_parse_file ../../gcc-trunk/gcc/fortran/f95-lang.cc:229