diff options
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 485d331..05f2c14 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -2336,17 +2336,18 @@ resolve_function (gfc_expr *expr) assumed size array argument. UBOUND and SIZE have to be excluded from the check if the second argument is anything than a constant. */ - int inquiry; - inquiry = GENERIC_ID == GFC_ISYM_UBOUND - || GENERIC_ID == GFC_ISYM_SIZE; for (arg = expr->value.function.actual; arg; arg = arg->next) { - if (inquiry && arg->next != NULL && arg->next->expr) + if ((GENERIC_ID == GFC_ISYM_UBOUND || GENERIC_ID == GFC_ISYM_SIZE) + && arg->next != NULL && arg->next->expr) { if (arg->next->expr->expr_type != EXPR_CONSTANT) break; + if (arg->next->name && strncmp(arg->next->name, "kind", 4) == 0) + break; + if ((int)mpz_get_si (arg->next->expr->value.integer) < arg->expr->rank) break; |