aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/simplify.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/simplify.c')
-rw-r--r--gcc/fortran/simplify.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index b46cbfa..f40e493 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -7471,6 +7471,7 @@ simplify_size (gfc_expr *array, gfc_expr *dim, int k)
mpz_t size;
gfc_expr *return_value;
int d;
+ gfc_ref *ref;
/* For unary operations, the size of the result is given by the size
of the operand. For binary ones, it's the size of the first operand
@@ -7527,6 +7528,10 @@ simplify_size (gfc_expr *array, gfc_expr *dim, int k)
return simplified;
}
+ for (ref = array->ref; ref; ref = ref->next)
+ if (ref->type == REF_ARRAY && ref->u.ar.as)
+ gfc_resolve_array_spec (ref->u.ar.as, 0);
+
if (dim == NULL)
{
if (!gfc_array_size (array, &size))