https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103474
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gcc dot gnu.org --- Comment #3 from anlauf at gcc dot gnu.org --- The patch in comment#1 fixes comment#0, but not comment#2, which hits another assert. That one needs additionally something like @@ -4353,7 +4356,8 @@ simplify_cobound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind, int upper) case AR_ELEMENT: if (ref->u.ar.as->corank > 0) { - gcc_assert (as == ref->u.ar.as); +// gcc_assert (as == ref->u.ar.as); + as = ref->u.ar.as; goto done; } as = NULL; However, that would lead to silent acceptance of invalid code which needs checking elsewhere.