aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 94b8e0e..02143c2 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -1210,7 +1210,12 @@ find_array_section (gfc_expr *expr, gfc_ref *ref)
}
gcc_assert (begin->rank == 1);
- gcc_assert (begin->shape);
+ /* Zero-sized arrays have no shape and no elements, stop early. */
+ if (!begin->shape)
+ {
+ mpz_init_set_ui (nelts, 0);
+ break;
+ }
vecsub[d] = begin->value.constructor;
mpz_set (ctr[d], vecsub[d]->expr->value.integer);