diff options
author | Tobias Burnus <burnus@gcc.gnu.org> | 2008-09-06 17:27:50 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2008-09-06 17:27:50 +0200 |
commit | 7a687b22659e54dfc9a6354b08b850d63bfd14c0 (patch) | |
tree | 4465d54b9e7f10e095ffb815f9791bdfd277f191 /gcc/fortran/resolve.c | |
parent | 2c68bc89b7f04ee6e599afb8a75734641e5a5038 (diff) | |
download | gcc-7a687b22659e54dfc9a6354b08b850d63bfd14c0.zip gcc-7a687b22659e54dfc9a6354b08b850d63bfd14c0.tar.gz gcc-7a687b22659e54dfc9a6354b08b850d63bfd14c0.tar.bz2 |
[multiple changes]
2008-09-06 Steven G. Kargl <kargls@comcast.net>
PR fortran/36153
* fortran/resolve.c (resolve_function): Shortcircuit for SIZE and
UBOUND if 2nd argument is KIND.
2008-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/36153
* gfortran.dg/size_kind.f90: New test.
From-SVN: r140063
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; |