Index: simplify.c =================================================================== --- simplify.c (Revision 221757) +++ simplify.c (Arbeitskopie) @@ -3445,6 +3445,25 @@ simplify_bound (gfc_expr *array, gfc_expr *dim, gf done: + if (!upper && as->type == AS_ASSUMED_SHAPE && dim) + { + if (dim->expr_type == EXPR_CONSTANT) + { + unsigned long int ndim; + gfc_expr *lower, *res; + + ndim = mpz_get_si (dim->value.integer) - 1; + lower = as->lower[ndim]; + if (lower->expr_type == EXPR_CONSTANT) + { + int nkind = mpz_get_si (kind->value.integer); + res = gfc_copy_expr (lower); + res->ts.kind = nkind; + return res; + } + } + } + if (as && (as->type == AS_DEFERRED || as->type == AS_ASSUMED_SHAPE || as->type == AS_ASSUMED_RANK)) return NULL;