|| end->expr_type != EXPR_CONSTANT)
{
gfc_error ("end of implied-do loop at %L could not be "
- "simplified to a constant value", &start->where);
+ "simplified to a constant value", &end->where);
retval = false;
goto cleanup;
}
|| step->expr_type != EXPR_CONSTANT)
{
gfc_error ("step of implied-do loop at %L could not be "
- "simplified to a constant value", &start->where);
+ "simplified to a constant value", &step->where);
+ retval = false;
+ goto cleanup;
+ }
+ if (mpz_cmp_si (step->value.integer, 0) == 0)
+ {
+ gfc_error ("step of implied-do loop at %L shall not be zero",
+ &step->where);
retval = false;
goto cleanup;
}
--- /dev/null
+! { dg-do compile }
+! PR fortran/85796 - Floating point exception with implied do in data statement
+
+program p
+ implicit none
+ integer :: i, j, x(2,2)
+ data ((x(i,j),i=1,2,j-1),j=1,2) /3*789/ ! { dg-error "step of implied-do loop" }
+end