+2015-06-02 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ * simplify.c (gfc_simplify_reshape): Convert assert into returning
+ NULL, which triggers an error condition.
+
2015-05-27 Andre Vehreschild <vehre@gmx.de>
PR fortran/65548
e = gfc_constructor_lookup_expr (source->value.constructor, j);
else
{
- gcc_assert (npad > 0);
-
+ if (npad <= 0)
+ {
+ mpz_clear (index);
+ return NULL;
+ }
j = j - nsource;
j = j % npad;
e = gfc_constructor_lookup_expr (pad->value.constructor, j);
--- /dev/null
+! { dg-do compile }
+! PR fortran/66380
+!
+subroutine p0
+ integer, parameter :: sh(2) = [2, 3]
+ integer, parameter :: &
+ & a(2,2) = reshape([1, 2, 3, 4], sh) ! { dg-error "Different shape" }
+ if (a(1,1) /= 0) call abort
+end subroutine p0
+
+
+subroutine p1
+ integer, parameter :: sh(2) = [2, 1]
+ integer, parameter :: &
+ & a(2,2) = reshape([1, 2, 3, 4], sh) ! { dg-error "Different shape" }
+ if (a(1,1) /= 0) call abort
+end subroutine p1