This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [fortran, patch] pr31760, missing elemental applicability


On Sunday 29 April 2007 23:44:34 I wrote:

> 2007-04-29  Daniel Franke  <franke.daniel@gmail.com>
>
> 	PR fortran/31760
> 	* intrinsic.c (add_functions): Replaced calls to gfc_check_g77_math1
> 	by gfc_check_fn_r to avoid checks for scalarity.
> 	* check.c (gfc_check_besn): Removed check for scalarity.
> 	(gfc_check_g77_math1): Removed.
> 	* intrinsic.h (gfc_check_g77_math1): Removed.

Again, with patch.
Index: intrinsic.c
===================================================================
--- intrinsic.c	(revision 124274)
+++ intrinsic.c	(working copy)
@@ -1097,21 +1097,21 @@
   
   /* Bessel and Neumann functions for G77 compatibility.  */
   add_sym_1 ("besj0", ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
-	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
 	     x, BT_REAL, dr, REQUIRED);
 
   add_sym_1 ("dbesj0", ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
-	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
 	     x, BT_REAL, dd, REQUIRED);
 
   make_generic ("besj0", GFC_ISYM_J0, GFC_STD_GNU);
 
   add_sym_1 ("besj1", ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
-	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
 	     x, BT_REAL, dr, REQUIRED);
 
   add_sym_1 ("dbesj1", ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
-	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
 	     x, BT_REAL, dd, REQUIRED);
 
   make_generic ("besj1", GFC_ISYM_J1, GFC_STD_GNU);
@@ -1127,21 +1127,21 @@
   make_generic ("besjn", GFC_ISYM_JN, GFC_STD_GNU);
 
   add_sym_1 ("besy0", ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
-	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
 	     x, BT_REAL, dr, REQUIRED);
 
   add_sym_1 ("dbesy0", ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
-	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
 	     x, BT_REAL, dd, REQUIRED);
 
   make_generic ("besy0", GFC_ISYM_Y0, GFC_STD_GNU);
 
   add_sym_1 ("besy1", ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
-	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
 	     x, BT_REAL, dr, REQUIRED);
 
   add_sym_1 ("dbesy1", ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
-	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
 	     x, BT_REAL, dd, REQUIRED);
 
   make_generic ("besy1", GFC_ISYM_Y1, GFC_STD_GNU);
@@ -1340,21 +1340,21 @@
 
   /* G77 compatibility for the ERF() and ERFC() functions.  */
   add_sym_1 ("erf", ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
-	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
 	     x, BT_REAL, dr, REQUIRED);
 
   add_sym_1 ("derf", ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
-	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
 	     x, BT_REAL, dd, REQUIRED);
 
   make_generic ("erf", GFC_ISYM_ERF, GFC_STD_GNU);
 
   add_sym_1 ("erfc", ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
-	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
 	     x, BT_REAL, dr, REQUIRED);
 
   add_sym_1 ("derfc", ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
-	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
 	     x, BT_REAL, dd, REQUIRED);
 
   make_generic ("erfc", GFC_ISYM_ERFC, GFC_STD_GNU);
Index: intrinsic.h
===================================================================
--- intrinsic.h	(revision 124274)
+++ intrinsic.h	(working copy)
@@ -62,7 +62,6 @@
 try gfc_check_fn_r (gfc_expr *);
 try gfc_check_fn_rc (gfc_expr *);
 try gfc_check_fnum (gfc_expr *);
-try gfc_check_g77_math1 (gfc_expr *);
 try gfc_check_hostnm (gfc_expr *);
 try gfc_check_huge (gfc_expr *);
 try gfc_check_i (gfc_expr *);
Index: check.c
===================================================================
--- check.c	(revision 124274)
+++ check.c	(working copy)
@@ -655,9 +655,6 @@
   if (type_check (n, 0, BT_INTEGER) == FAILURE)
     return FAILURE;
 
-  if (scalar_check (x, 1) == FAILURE)
-    return FAILURE;
-
   if (type_check (x, 1, BT_REAL) == FAILURE)
     return FAILURE;
 
@@ -1037,23 +1034,7 @@
 }
 
 
-/* This is used for the g77 one-argument Bessel functions, and the
-   error function.  */
-
 try
-gfc_check_g77_math1 (gfc_expr *x)
-{
-  if (scalar_check (x, 0) == FAILURE)
-    return FAILURE;
-
-  if (type_check (x, 0, BT_REAL) == FAILURE)
-    return FAILURE;
-
-  return SUCCESS;
-}
-
-
-try
 gfc_check_huge (gfc_expr *x)
 {
   if (int_or_real_check (x, 0) == FAILURE)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]