https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103692
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-valid-code --- Comment #4 from anlauf at gcc dot gnu.org --- We need to handle zero-sized constructors. Tentative patch: diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 472304326e8..f1d92e00c98 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -1883,6 +1883,9 @@ gfc_expand_constructor (gfc_expr *e, bool fatal) gfc_expr *f; bool rc; + if (gfc_is_size_zero_array (e)) + return true; + /* If we can successfully get an array element at the max array size then the array is too big to expand, so we just return. */ f = gfc_get_array_element (e, flag_max_array_constructor);