http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59765
--- Comment #5 from janus at gcc dot gnu.org ---
In particular this code in finalize_component produces a full-array reference
for array components:
if (comp->attr.dimension || comp->attr.codimension
|| (comp->ts.type == BT_CLASS && CLASS_DATA (comp)
&& (CLASS_DATA (comp)->attr.dimension
|| CLASS_DATA (comp)->attr.codimension)))
{
ref->next = gfc_get_ref ();
ref->next->type = REF_ARRAY;
ref->next->u.ar.dimen = 0;
ref->next->u.ar.as = comp->ts.type == BT_CLASS ? CLASS_DATA (comp)->as
: comp->as;
e->rank = ref->next->u.ar.as->rank;
ref->next->u.ar.type = e->rank ? AR_FULL : AR_ELEMENT;
}
Either we have to scalarize this later on (this is currently not implemented,
because this is forbidden in actual Fortran code, see comment 4), or we have to
generate a loop directly instead of the full-array expression.