https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71203
--- Comment #15 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- (In reply to Gerhard Steinmetz from comment #1) > $ cat z4.f90 > program p > integer :: i > integer, parameter :: x(2) = 0 > integer, parameter :: y(*) = [(x(i:i), i=1,2)] > end > The patch Index: decl.c =================================================================== --- decl.c (Revision 269443) +++ decl.c (Arbeitskopie) @@ -1983,8 +1983,14 @@ add_init_expr_to_sym (const char *name, gfc_expr * return false; } - /* Shape should be present, we get an initialization expression. */ - gcc_assert (init->shape); + /* The shape may be NULL for EXPR_ARRAY, set it. */ + if (init->shape == NULL) + { + gcc_assert (init->expr_type == EXPR_ARRAY); + init->shape = gfc_get_shape (1); + if (!gfc_array_size (init, &init->shape[0])) + gfc_internal_error ("bletchful state"); + } for (dim = 0; dim < sym->as->rank; ++dim) { fixes this, but a) causes some strange regression in the testsuite, some tree dump patterns in assumed_type_2.f90 and no_arg_check_2.f90 and b) might not the right place to put in the shape.