https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95372
kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2020-06-05 CC| |kargl at gcc dot gnu.org Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Priority|P3 |P4 --- Comment #1 from kargl at gcc dot gnu.org --- This allows the code to compile and print 1. Index: gcc/fortran/expr.c =================================================================== --- gcc/fortran/expr.c (revision 280157) +++ gcc/fortran/expr.c (working copy) @@ -1684,7 +1684,13 @@ find_array_section (gfc_expr *expr, gfc_ref *ref) } cons = gfc_constructor_lookup (base, limit); - gcc_assert (cons); + + if (!cons) + { + t = false; + goto cleanup; + } + gfc_constructor_append_expr (&expr->value.constructor, gfc_copy_expr (cons->expr), NULL); }