+2019-03-09 Thomas König <tkoenig@gcc.gnu.org>
+
+ PR fortran/71203
+ * decl.c (add_init_expr_to_sym): Add shape if init has none. Add
+ asserts that it has to be an EXPR_ARRAY in this case.
+
2019-03-08 Jakub Jelinek <jakub@redhat.com>
PR other/80058
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 ("gfc_array_size failed");
+ }
for (dim = 0; dim < sym->as->rank; ++dim)
{
+2019-03-09 Thomas König <tkoenig@gcc.gnu.org>
+
+ PR fortran/71203
+ * gfortran.dg/array_simplify_3.f90: New test case.
+
2019-03-09 Jakub Jelinek <jakub@redhat.com>
PR c/88568
--- /dev/null
+! { dg-do run }
+! PR 71203 - this used to ICE
+program p
+ integer :: i
+ integer, parameter :: x(2) = 0
+ integer, parameter :: y(*) = [(x(i:i), i=1,2)]
+ if (size(y,1) /= 2) stop 1
+ if (any(y /= 0)) stop 2
+end