From 8fb2cc6b24b32595ad1e50ef38a3847799574290 Mon Sep 17 00:00:00 2001 From: Thomas Koenig Date: Tue, 30 Jan 2018 22:35:34 +0000 Subject: re PR fortran/84134 (ICE: Floating point exception) 2017-01-30 Thomas Koenig PR fortran/84134 * array.c (gfc_ref_dimen_size): Whitespace fixes. If stride is zero, return false. 2017-01-30 Thomas Koenig PR fortran/84134 * gfortran.dg/data_implied_do_2.f90: New test. From-SVN: r257211 --- gcc/fortran/array.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/array.c') diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 22a5ddc..ee13d92 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -2245,9 +2245,12 @@ gfc_ref_dimen_size (gfc_array_ref *ar, int dimen, mpz_t *result, mpz_t *end) else { stride_expr = gfc_copy_expr(ar->stride[dimen]); + if(!gfc_simplify_expr(stride_expr, 1)) gfc_internal_error("Simplification error"); - if (stride_expr->expr_type != EXPR_CONSTANT) + + if (stride_expr->expr_type != EXPR_CONSTANT + || mpz_cmp_ui (stride_expr->value.integer, 0) == 0) { mpz_clear (stride); return false; -- cgit v1.1