diff options
author | Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> | 2004-08-22 14:09:26 +0200 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2004-08-22 14:09:26 +0200 |
commit | 617097a3374140b8ec5a4e991ff69fbe94329b74 (patch) | |
tree | 26a3905b35b9b195a14c3066f37f48183340871d /gcc/fortran/check.c | |
parent | 60e6c8521675dbd85ffa40cc40c5ee489c8ef502 (diff) | |
download | gcc-617097a3374140b8ec5a4e991ff69fbe94329b74.zip gcc-617097a3374140b8ec5a4e991ff69fbe94329b74.tar.gz gcc-617097a3374140b8ec5a4e991ff69fbe94329b74.tar.bz2 |
check.c (gfc_check_reduction): Rename to ...
* check.c (gfc_check_reduction): Rename to ...
(check_reduction): ... this. Make static. Don't check type of
first argument.
(gfc_check_minval_maxval, gfc_check_prodcut_sum): New functions.
* intrinsic.c (add_functions): Change MAXVAL, MINVAL, PRODUCT and
SUM to use new check functions.
(check_specific): Change logic to call new functions.
* intrinsic.h (gfc_check_minval_maxval, gfc_check_product_sum):
Add prototypes.
(gfc_check_reduction): Remove prototype.
From-SVN: r86377
Diffstat (limited to 'gcc/fortran/check.c')
-rw-r--r-- | gcc/fortran/check.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index aff024a..9e5906a 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -1150,15 +1150,10 @@ gfc_check_minloc_maxloc (gfc_actual_arglist * ap) I.e. in the case of minval(array,mask), mask will be in the second position of the argument list and we'll have to fix that up. */ -try -gfc_check_reduction (gfc_actual_arglist * ap) +static try +check_reduction (gfc_actual_arglist * ap) { - gfc_expr *a, *m, *d; - - a = ap->expr; - if (int_or_real_check (a, 0) == FAILURE - || array_check (a, 0) == FAILURE) - return FAILURE; + gfc_expr *m, *d; d = ap->next->expr; m = ap->next->next->expr; @@ -1186,6 +1181,30 @@ gfc_check_reduction (gfc_actual_arglist * ap) try +gfc_check_minval_maxval (gfc_actual_arglist * ap) +{ + + if (int_or_real_check (ap->expr, 0) == FAILURE + || array_check (ap->expr, 0) == FAILURE) + return FAILURE; + + return check_reduction (ap); +} + + +try +gfc_check_product_sum (gfc_actual_arglist * ap) +{ + + if (numeric_check (ap->expr, 0) == FAILURE + || array_check (ap->expr, 0) == FAILURE) + return FAILURE; + + return check_reduction (ap); +} + + +try gfc_check_merge (gfc_expr * tsource, gfc_expr * fsource, gfc_expr * mask) { |