From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91711 invoked by alias); 8 Oct 2017 18:05:33 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 91692 invoked by uid 89); 8 Oct 2017 18:05:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-9.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=fraction, tiny, wwwyoutubecom, UD:youtube.com X-Spam-User: qpsmtpd, 2 recipients X-HELO: troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (HELO troutmask.apl.washington.edu) (128.95.76.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 08 Oct 2017 18:05:23 +0000 Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id v98I5KLO010026 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 8 Oct 2017 11:05:20 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id v98I5KtF010025; Sun, 8 Oct 2017 11:05:20 -0700 (PDT) (envelope-from sgk) Date: Sun, 08 Oct 2017 18:05:00 -0000 From: Steve Kargl To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [Fortran] Committed patch. Message-ID: <20171008180520.GA10016@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline User-Agent: Mutt/1.7.2 (2016-11-26) X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00053.txt.bz2 --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 515 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 * 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 --HlL+5n6rz5pIUxbD Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="check.diff" Content-length: 4945 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); --HlL+5n6rz5pIUxbD--