diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2018-01-30 22:35:34 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2018-01-30 22:35:34 +0000 |
commit | 8fb2cc6b24b32595ad1e50ef38a3847799574290 (patch) | |
tree | 04378266045fd4570ebf4987fcb9b36b0ab2ae3d /gcc/fortran/array.c | |
parent | f58d41ff24cd35c9a351c2d805c869552576baae (diff) | |
download | gcc-8fb2cc6b24b32595ad1e50ef38a3847799574290.zip gcc-8fb2cc6b24b32595ad1e50ef38a3847799574290.tar.gz gcc-8fb2cc6b24b32595ad1e50ef38a3847799574290.tar.bz2 |
re PR fortran/84134 (ICE: Floating point exception)
2017-01-30 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/84134
* array.c (gfc_ref_dimen_size): Whitespace fixes. If stride is
zero, return false.
2017-01-30 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/84134
* gfortran.dg/data_implied_do_2.f90: New test.
From-SVN: r257211
Diffstat (limited to 'gcc/fortran/array.c')
-rw-r--r-- | gcc/fortran/array.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; |