+2013-11-05 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/58989
+ * check.c (gfc_check_reshape): ensure that shape is a constant
+ expression.
+
2013-11-05 Tobias Burnus <burnus@net-b.de>
* lang.opt (fopenmp-simd): New option.
"than %d elements", &shape->where, GFC_MAX_DIMENSIONS);
return false;
}
- else if (shape->expr_type == EXPR_ARRAY)
+ else if (shape->expr_type == EXPR_ARRAY && gfc_is_constant_expr (shape))
{
gfc_expr *e;
int i, extent;
+2013-11-05 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/58989
+ * gfortran.dg/reshape_6.f90: New test.
+
2013-10-05 Jeff Law <law@redhat.com>
* gcc.dg/pr38984.c: Add -fno-isolate-erroneous-paths.
--- /dev/null
+! { dg-do compile }
+! PR fortran/58989
+!
+program test
+
+ real(8), dimension(4,4) :: fluxes
+ real(8), dimension(2,2,2,2) :: f
+ integer, dimension(3) :: dmmy
+ integer, parameter :: indx(4)=(/2,2,2,2/)
+
+ fluxes = 1
+
+ dmmy = (/2,2,2/)
+
+ f = reshape(fluxes,(/dmmy,2/)) ! Caused an ICE
+ f = reshape(fluxes,(/2,2,2,2/)) ! Works as expected
+ f = reshape(fluxes,indx) ! Works as expected
+
+end program test