https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100136
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-valid-code --- Comment #6 from anlauf at gcc dot gnu.org --- (In reply to José Rui Faustino de Sousa from comment #3) > Only handles the ICE... > > Patch posted: > > https://gcc.gnu.org/pipermail/fortran/2021-April/055949.html Hi Jose, unfortunately it appears that your patch was never reviewed, and you did not ping it. I think the patch is mostly fine, but that it should use POINTER_TYPE_P (TREE_TYPE (tmp)), so that it reads (adjusted to mainline): diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc index 850007fd2e1..e35ea2fc790 100644 --- a/gcc/fortran/trans-expr.cc +++ b/gcc/fortran/trans-expr.cc @@ -7220,16 +7220,15 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, else goto end_pointer_check; + tmp = parmse.expr; if (fsym && fsym->ts.type == BT_CLASS) { - tmp = build_fold_indirect_ref_loc (input_location, - parmse.expr); + if (POINTER_TYPE_P (TREE_TYPE (tmp))) + tmp = build_fold_indirect_ref_loc (input_location, tmp); tmp = gfc_class_data_get (tmp); if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (tmp))) tmp = gfc_conv_descriptor_data_get (tmp); } - else - tmp = parmse.expr; /* If the argument is passed by value, we need to strip the INDIRECT_REF. */ Are you still working on gfortran? Or should I pick up your patch and resubmit for you?