https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88047
janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |janus at gcc dot gnu.org --- Comment #7 from janus at gcc dot gnu.org --- (In reply to Dominique d'Humieres from comment #6) > Janus, could please you figure out why class_array_3.f03 is failing with > your patch? I think the problem is that for class arrays the proper array refs are only established at resolution stage, so that gfc_expr_attr does not yet work at parsing stage, leading to the ICE shown in comment #4. I see no simple way to change that. In consequence, I propose the following patch: @@ -2846,7 +2846,10 @@ gfc_find_vtab (gfc_typespec *ts) case BT_DERIVED: return gfc_find_derived_vtab (ts->u.derived); case BT_CLASS: - return gfc_find_derived_vtab (ts->u.derived->components->ts.u.derived); + if (ts->u.derived->components && ts->u.derived->components->ts.u.derived) + return gfc_find_derived_vtab (ts->u.derived->components->ts.u.derived); + else + return NULL; default: return find_intrinsic_vtab (ts); } It fixes the ICEs on comment #0 and comment #5 and regtests cleanly.