From 8a92685e533c18273aa82b7eb5287cbcbbd29f81 Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Fri, 9 Sep 2016 17:57:11 +0000 Subject: [PATCH] re PR fortran/77507 (gfortran rejects keyworded calls to procedures from intrinsic modules) 2016-09-09 Steven G. Kargl PR fortran/77507 * intrinsic.c (add_functions): Use correct keyword. 2016-09-09 Steven G. Kargl PR fortran/77507 * ieee/ieee_arithmetic.F90 (IEEE_VALUE_4,IEEE_VALUE_8,IEEE_VALULE_10, IEEE_VALUE_16): Use correct keyword. 2016-09-09 Steven G. Kargl PR fortran/77507 * gfortran.dg/pr77507.f90: New test. From-SVN: r240050 --- gcc/fortran/ChangeLog | 5 ++++ gcc/fortran/intrinsic.c | 7 +++--- gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/gfortran.dg/pr77507.f90 | 7 ++++++ libgfortran/ChangeLog | 6 +++++ libgfortran/ieee/ieee_arithmetic.F90 | 33 ++++++++++++++------------- 6 files changed, 44 insertions(+), 19 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/pr77507.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 53c6e2d50a9..a0afe045b9a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2016-09-09 Steven G. Kargl + + PR fortran/77507 + * intrinsic.c (add_functions): Use correct keyword. + 2016-09-08 Steven G. Kargl PR fortran/69514 diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c index ca28eac8cf7..cad54b8100b 100644 --- a/gcc/fortran/intrinsic.c +++ b/gcc/fortran/intrinsic.c @@ -1239,7 +1239,8 @@ add_functions (void) *z = "z", *ln = "len", *ut = "unit", *han = "handler", *num = "number", *tm = "time", *nm = "name", *md = "mode", *vl = "values", *p1 = "path1", *p2 = "path2", *com = "command", - *ca = "coarray", *sub = "sub", *dist = "distance", *failed="failed"; + *ca = "coarray", *sub = "sub", *dist = "distance", *failed="failed", + *c_ptr_1 = "c_ptr_1", *c_ptr_2 = "c_ptr_2"; int di, dr, dd, dl, dc, dz, ii; @@ -2914,8 +2915,8 @@ add_functions (void) /* The following functions are part of ISO_C_BINDING. */ add_sym_2 ("c_associated", GFC_ISYM_C_ASSOCIATED, CLASS_INQUIRY, ACTUAL_NO, BT_LOGICAL, dl, GFC_STD_F2003, gfc_check_c_associated, NULL, NULL, - "C_PTR_1", BT_VOID, 0, REQUIRED, - "C_PTR_2", BT_VOID, 0, OPTIONAL); + c_ptr_1, BT_VOID, 0, REQUIRED, + c_ptr_2, BT_VOID, 0, OPTIONAL); make_from_module(); add_sym_1 ("c_loc", GFC_ISYM_C_LOC, CLASS_INQUIRY, ACTUAL_NO, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 00691b57117..407bc30084c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-09-09 Steven G. Kargl + + PR fortran/77507 + * gfortran.dg/pr77507.f90: New test. + 2016-09-09 Joseph Myers * gcc.dg/limits-width-1.c, gcc.dg/stdint-width-1.c: New tests. diff --git a/gcc/testsuite/gfortran.dg/pr77507.f90 b/gcc/testsuite/gfortran.dg/pr77507.f90 new file mode 100644 index 00000000000..a72a0915ca0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr77507.f90 @@ -0,0 +1,7 @@ +! { dg-do compile } +Program p + Use ieee_arithmetic + Use iso_c_binding + Print *, ieee_value(x=1.0, class=ieee_negative_inf) + Print *, c_associated(c_ptr_1=c_null_ptr) +End Program diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index b445cd0f848..6454eaeb826 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2016-09-09 Steven G. Kargl + + PR fortran/77507 + * ieee/ieee_arithmetic.F90 (IEEE_VALUE_4,IEEE_VALUE_8,IEEE_VALULE_10, + IEEE_VALUE_16): Use correct keyword. + 2016-09-06 Jerry DeLisle PR libgfortran/77393 diff --git a/libgfortran/ieee/ieee_arithmetic.F90 b/libgfortran/ieee/ieee_arithmetic.F90 index 16e79eceb9a..4007a33358e 100644 --- a/libgfortran/ieee/ieee_arithmetic.F90 +++ b/libgfortran/ieee/ieee_arithmetic.F90 @@ -857,12 +857,12 @@ contains ! IEEE_VALUE - elemental real(kind=4) function IEEE_VALUE_4(X, C) result(res) - implicit none + elemental real(kind=4) function IEEE_VALUE_4(X, CLASS) result(res) + real(kind=4), intent(in) :: X - type(IEEE_CLASS_TYPE), intent(in) :: C + type(IEEE_CLASS_TYPE), intent(in) :: CLASS - select case (C%hidden) + select case (CLASS%hidden) case (1) ! IEEE_SIGNALING_NAN res = -1 res = sqrt(res) @@ -895,12 +895,12 @@ contains end select end function - elemental real(kind=8) function IEEE_VALUE_8(X, C) result(res) - implicit none + elemental real(kind=8) function IEEE_VALUE_8(X, CLASS) result(res) + real(kind=8), intent(in) :: X - type(IEEE_CLASS_TYPE), intent(in) :: C + type(IEEE_CLASS_TYPE), intent(in) :: CLASS - select case (C%hidden) + select case (CLASS%hidden) case (1) ! IEEE_SIGNALING_NAN res = -1 res = sqrt(res) @@ -934,12 +934,12 @@ contains end function #ifdef HAVE_GFC_REAL_10 - elemental real(kind=10) function IEEE_VALUE_10(X, C) result(res) - implicit none + elemental real(kind=10) function IEEE_VALUE_10(X, CLASS) result(res) + real(kind=10), intent(in) :: X - type(IEEE_CLASS_TYPE), intent(in) :: C + type(IEEE_CLASS_TYPE), intent(in) :: CLASS - select case (C%hidden) + select case (CLASS%hidden) case (1) ! IEEE_SIGNALING_NAN res = -1 res = sqrt(res) @@ -971,15 +971,16 @@ contains res = 0 end select end function + #endif #ifdef HAVE_GFC_REAL_16 - elemental real(kind=16) function IEEE_VALUE_16(X, C) result(res) - implicit none + elemental real(kind=16) function IEEE_VALUE_16(X, CLASS) result(res) + real(kind=16), intent(in) :: X - type(IEEE_CLASS_TYPE), intent(in) :: C + type(IEEE_CLASS_TYPE), intent(in) :: CLASS - select case (C%hidden) + select case (CLASS%hidden) case (1) ! IEEE_SIGNALING_NAN res = -1 res = sqrt(res) -- 2.30.2