public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [Fortran] Committed patch.
@ 2017-10-08 18:05 Steve Kargl
  0 siblings, 0 replies; only message in thread
From: Steve Kargl @ 2017-10-08 18:05 UTC (permalink / raw)
  To: fortran, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 515 bytes --]

In check.c, gfc_check_x and gfc_check_fn_r were indentical functions
(well other than the names).  I have removed gfc_check_x and updated
its uses to those of gfc_check_fn_r.  After a bootstrap and regression
testing I've committed the attached patch.

2017-10-08  Steven G. Kargl  <kargl@gcc.gnu.org>

	* check.c (gfc_check_x): Remove function.
	* intrinsic.c (add_functions): Use gfc_check_fn_r.

-- 
Steve
20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4
20161221 https://www.youtube.com/watch?v=IbCHE-hONow

[-- Attachment #2: check.diff --]
[-- Type: text/x-diff, Size: 4945 bytes --]

Index: gcc/fortran/check.c
===================================================================
--- gcc/fortran/check.c	(revision 253527)
+++ gcc/fortran/check.c	(working copy)
@@ -2262,6 +2262,7 @@ gfc_check_fn_c (gfc_expr *a)
   return true;
 }
 
+
 /* A single real argument.  */
 
 bool
@@ -5506,19 +5507,6 @@ gfc_check_ttynam (gfc_expr *unit)
     return false;
 
   if (!type_check (unit, 0, BT_INTEGER))
-    return false;
-
-  return true;
-}
-
-
-/* Common check function for the half a dozen intrinsics that have a
-   single real argument.  */
-
-bool
-gfc_check_x (gfc_expr *x)
-{
-  if (!type_check (x, 0, BT_REAL))
     return false;
 
   return true;
Index: gcc/fortran/intrinsic.c
===================================================================
--- gcc/fortran/intrinsic.c	(revision 253527)
+++ gcc/fortran/intrinsic.c	(working copy)
@@ -1760,8 +1760,8 @@ add_functions (void)
 
   make_generic ("eoshift", GFC_ISYM_EOSHIFT, GFC_STD_F95);
 
-  add_sym_1 ("epsilon", GFC_ISYM_EPSILON, CLASS_INQUIRY, ACTUAL_NO, BT_REAL, dr, GFC_STD_F95,
-	     gfc_check_x, gfc_simplify_epsilon, NULL,
+  add_sym_1 ("epsilon", GFC_ISYM_EPSILON, CLASS_INQUIRY, ACTUAL_NO, BT_REAL, dr,
+	     GFC_STD_F95, gfc_check_fn_r, gfc_simplify_epsilon, NULL,
 	     x, BT_REAL, dr, REQUIRED);
 
   make_generic ("epsilon", GFC_ISYM_EPSILON, GFC_STD_F95);
@@ -1827,8 +1827,8 @@ add_functions (void)
 
   make_generic ("exp", GFC_ISYM_EXP, GFC_STD_F77);
 
-  add_sym_1 ("exponent", GFC_ISYM_EXPONENT, CLASS_ELEMENTAL, ACTUAL_NO, BT_INTEGER, di, GFC_STD_F95,
-	     gfc_check_x, gfc_simplify_exponent, gfc_resolve_exponent,
+  add_sym_1 ("exponent", GFC_ISYM_EXPONENT, CLASS_ELEMENTAL, ACTUAL_NO, BT_INTEGER, di,
+	     GFC_STD_F95, gfc_check_fn_r, gfc_simplify_exponent, gfc_resolve_exponent,
 	     x, BT_REAL, dr, REQUIRED);
 
   make_generic ("exponent", GFC_ISYM_EXPONENT, GFC_STD_F95);
@@ -1865,8 +1865,8 @@ add_functions (void)
 
   make_generic ("fnum", GFC_ISYM_FNUM, GFC_STD_GNU);
 
-  add_sym_1 ("fraction", GFC_ISYM_FRACTION, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_F95,
-	     gfc_check_x, gfc_simplify_fraction, gfc_resolve_fraction,
+  add_sym_1 ("fraction", GFC_ISYM_FRACTION, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr,
+	     GFC_STD_F95, gfc_check_fn_r, gfc_simplify_fraction, gfc_resolve_fraction,
 	     x, BT_REAL, dr, REQUIRED);
 
   make_generic ("fraction", GFC_ISYM_FRACTION, GFC_STD_F95);
@@ -2449,8 +2449,8 @@ add_functions (void)
 
   make_generic ("max", GFC_ISYM_MAX, GFC_STD_F77);
 
-  add_sym_1 ("maxexponent", GFC_ISYM_MAXEXPONENT, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER, di,
-	     GFC_STD_F95, gfc_check_x, gfc_simplify_maxexponent, NULL,
+  add_sym_1 ("maxexponent", GFC_ISYM_MAXEXPONENT, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER,
+	     di, GFC_STD_F95, gfc_check_fn_r, gfc_simplify_maxexponent, NULL,
 	     x, BT_UNKNOWN, dr, REQUIRED);
 
   make_generic ("maxexponent", GFC_ISYM_MAXEXPONENT, GFC_STD_F95);
@@ -2525,8 +2525,8 @@ add_functions (void)
 
   make_generic ("min", GFC_ISYM_MIN, GFC_STD_F77);
 
-  add_sym_1 ("minexponent", GFC_ISYM_MINEXPONENT, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER, di,
-	     GFC_STD_F95, gfc_check_x, gfc_simplify_minexponent, NULL,
+  add_sym_1 ("minexponent", GFC_ISYM_MINEXPONENT, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER,
+	     di, GFC_STD_F95, gfc_check_fn_r, gfc_simplify_minexponent, NULL,
 	     x, BT_UNKNOWN, dr, REQUIRED);
 
   make_generic ("minexponent", GFC_ISYM_MINEXPONENT, GFC_STD_F95);
@@ -2753,8 +2753,8 @@ add_functions (void)
 
   make_generic ("reshape", GFC_ISYM_RESHAPE, GFC_STD_F95);
 
-  add_sym_1 ("rrspacing", GFC_ISYM_RRSPACING, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_F95,
-	     gfc_check_x, gfc_simplify_rrspacing, gfc_resolve_rrspacing,
+  add_sym_1 ("rrspacing", GFC_ISYM_RRSPACING, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr,
+	     GFC_STD_F95, gfc_check_fn_r, gfc_simplify_rrspacing, gfc_resolve_rrspacing,
 	     x, BT_REAL, dr, REQUIRED);
 
   make_generic ("rrspacing", GFC_ISYM_RRSPACING, GFC_STD_F95);
@@ -2960,8 +2960,8 @@ add_functions (void)
 	     NULL, gfc_simplify_compiler_version, NULL);
   make_from_module();
 
-  add_sym_1 ("spacing", GFC_ISYM_SPACING, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_F95,
-	     gfc_check_x, gfc_simplify_spacing, gfc_resolve_spacing,
+  add_sym_1 ("spacing", GFC_ISYM_SPACING, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr,
+	     GFC_STD_F95, gfc_check_fn_r, gfc_simplify_spacing, gfc_resolve_spacing,
 	     x, BT_REAL, dr, REQUIRED);
 
   make_generic ("spacing", GFC_ISYM_SPACING, GFC_STD_F95);
@@ -3070,8 +3070,7 @@ add_functions (void)
   make_generic ("time8", GFC_ISYM_TIME8, GFC_STD_GNU);
 
   add_sym_1 ("tiny", GFC_ISYM_TINY, CLASS_INQUIRY, ACTUAL_NO, BT_REAL, dr, GFC_STD_F95,
-	     gfc_check_x, gfc_simplify_tiny, NULL,
-	     x, BT_REAL, dr, REQUIRED);
+	     gfc_check_fn_r, gfc_simplify_tiny, NULL, x, BT_REAL, dr, REQUIRED);
 
   make_generic ("tiny", GFC_ISYM_TINY, GFC_STD_F95);
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-08 18:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-08 18:05 [Fortran] Committed patch Steve Kargl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).