From a1bab9ea96f0a1a2e0b6030237fa4434eab78972 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tobias=20Schl=C3=BCter?= Date: Thu, 26 Aug 2004 19:11:27 +0200 Subject: [PATCH] check.c (gfc_check_atan2): New function. * check.c (gfc_check_atan2): New function. * intrinsic.c (add_functions): Use gfc_check_atan2 for ATAN2 * intrinsic.h (gfc_check_atan2): Add prototype. From-SVN: r86628 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/check.c | 12 ++++++++++++ gcc/fortran/intrinsic.c | 2 +- gcc/fortran/intrinsic.h | 1 + 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 9e727ca7a0b..6ab8f192010 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2004-08-26 Tobias Schlueter + + * check.c (gfc_check_atan2): New function. + * intrinsic.c (add_functions): Use gfc_check_atan2 for ATAN2 + * intrinsic.h (gfc_check_atan2): Add prototype. + 2004-08-25 Richard Henderson * arith.c (gfc_validate_kind): Add may_fail argument; abort if diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index acf16c5362a..32de0557893 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -513,6 +513,18 @@ gfc_check_associated (gfc_expr * pointer, gfc_expr * target) } +try +gfc_check_atan2 (gfc_expr * y, gfc_expr * x) +{ + if (type_check (y, 0, BT_REAL) == FAILURE) + return FAILURE; + if (same_type_check (y, 0, x, 1) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + try gfc_check_btest (gfc_expr * i, gfc_expr * pos) { diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c index 2784a7a03ea..ec344c7a646 100644 --- a/gcc/fortran/intrinsic.c +++ b/gcc/fortran/intrinsic.c @@ -975,7 +975,7 @@ add_functions (void) make_generic ("atan", GFC_ISYM_ATAN); add_sym_2 ("atan2", 1, 1, BT_REAL, dr, - NULL, gfc_simplify_atan2, gfc_resolve_atan2, + gfc_check_atan2, gfc_simplify_atan2, gfc_resolve_atan2, y, BT_REAL, dr, 0, x, BT_REAL, dr, 0); add_sym_2 ("datan2", 1, 1, BT_REAL, dd, diff --git a/gcc/fortran/intrinsic.h b/gcc/fortran/intrinsic.h index d09bcd02964..ef4fad57870 100644 --- a/gcc/fortran/intrinsic.h +++ b/gcc/fortran/intrinsic.h @@ -34,6 +34,7 @@ try gfc_check_abs (gfc_expr *); try gfc_check_all_any (gfc_expr *, gfc_expr *); try gfc_check_allocated (gfc_expr *); try gfc_check_associated (gfc_expr *, gfc_expr *); +try gfc_check_atan2 (gfc_expr *, gfc_expr *); try gfc_check_btest (gfc_expr *, gfc_expr *); try gfc_check_char (gfc_expr *, gfc_expr *); try gfc_check_cmplx (gfc_expr *, gfc_expr *, gfc_expr *); -- 2.30.2