Re: [PATCH] PR fortran/77507

2016-09-11 Thread Steve Kargl
On Sat, Sep 10, 2016 at 08:04:40PM +0200, Andreas Schwab wrote:
> FAIL: gfortran.dg/pr77507.f90   -O  (test for excess errors)
> Excess errors:
> /opt/gcc/gcc-20160910/gcc/testsuite/gfortran.dg/pr77507.f90:3:6: Fatal Error: 
> Can't open module file 'ieee_arithmetic.mod' for reading at (1): No such file 
> or directory
> 
> Andreas.
> 

Should be fixed by

Committed revision 240085

2016-09-11  Steven G. Kargl  

* gfortran.dg/pr77507.f90: Move to ...
* gfortran.dg/ieee/pr77507.f90: here.

-- 
Steve


Re: [PATCH] PR fortran/77507

2016-09-10 Thread Andreas Schwab
FAIL: gfortran.dg/pr77507.f90   -O  (test for excess errors)
Excess errors:
/opt/gcc/gcc-20160910/gcc/testsuite/gfortran.dg/pr77507.f90:3:6: Fatal Error: 
Can't open module file 'ieee_arithmetic.mod' for reading at (1): No such file 
or directory

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Re: [PATCH] PR fortran/77507

2016-09-10 Thread Steve Kargl
On Sat, Sep 10, 2016 at 09:03:16AM +0200, Andreas Schwab wrote:
> FAIL: gfortran.dg/c_assoc_2.f03   -O   (test for errors, line 23)
> 

Sorry about that.  Seems I forgot to check-in the
updated testcases with r240050.  Should be fixed
now.

-- 
Steve


Re: [PATCH] PR fortran/77507

2016-09-10 Thread Andreas Schwab
FAIL: gfortran.dg/c_assoc_2.f03   -O   (test for errors, line 23)

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Re: [PATCH] PR fortran/77507

2016-09-09 Thread Steven G. Kargl
On Fri, Sep 09, 2016 at 08:13:01AM -0700, Steven G. Kargl wrote:
> On Fri, Sep 09, 2016 at 01:47:40PM +0200, Paul Richard Thomas wrote:
> > 
> > This is OK for trunk. Are you backporting any of these fixes? If so,
> > you're OK to go back to 5-branch.
> > 
> 
> I have a pile of *.diff files that I will someday
> apply to at least 6.  I know I have lost a few diffs,
> so those need to be recreated.  After regression testing,
> I'll submit one massive backport patch.
> 

I forgot to mention to all the lurkers on the fortran@
mailing list.  This is an opportunity to get involved in
gfortran development.  Take any (or all) of my recent
patches to trunk and back port the patch(es) to the
5-branch and 6-branch.  I'm willing to answer any questions
that may come up.  Just think about the fame and fortune
that you'll reap through your contributions to humanity.

-- 
Steve
http://troutmask.apl.washington.edu/~kargl/


Re: [PATCH] PR fortran/77507

2016-09-09 Thread Steven G. Kargl
On Fri, Sep 09, 2016 at 01:47:40PM +0200, Paul Richard Thomas wrote:
> 
> This is OK for trunk. Are you backporting any of these fixes? If so,
> you're OK to go back to 5-branch.
> 

I have a pile of *.diff files that I will someday
apply to at least 6.  I know I have lost a few diffs,
so those need to be recreated.  After regression testing,
I'll submit one massive backport patch.

-- 
Steve
http://troutmask.apl.washington.edu/~kargl/


Re: [PATCH] PR fortran/77507

2016-09-09 Thread Paul Richard Thomas
Hi Steve,

This is OK for trunk. Are you backporting any of these fixes? If so,
you're OK to go back to 5-branch.

Thanks for the patch

Paul

On 9 September 2016 at 01:49, Steve Kargl
 wrote:
> The attached patch fixes issues with using keywords with
> the IEEE_VALUE and C_ASSOCIATED intrinsic routines.
> Regression tested on x86_64-*-freebsd.  OK to commit?
>
> 2016-09-08  Steven G. Kargl  
>
> PR fortran/77507
> * intrinsic.c (add_functions):  Use correct keyword.
>
> 2016-09-08  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-08  Steven G. Kargl  
>
> PR fortran/77507
> * gfortran.dg/pr77507.f90: New test.
>
> --
> Steve



-- 
The difference between genius and stupidity is; genius has its limits.

Albert Einstein


[PATCH] PR fortran/77507

2016-09-08 Thread Steve Kargl
The attached patch fixes issues with using keywords with
the IEEE_VALUE and C_ASSOCIATED intrinsic routines. 
Regression tested on x86_64-*-freebsd.  OK to commit?

2016-09-08  Steven G. Kargl  

PR fortran/77507
* intrinsic.c (add_functions):  Use correct keyword.

2016-09-08  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-08  Steven G. Kargl  

PR fortran/77507
* gfortran.dg/pr77507.f90: New test.

-- 
Steve
Index: gcc/fortran/intrinsic.c
===
--- gcc/fortran/intrinsic.c	(revision 240039)
+++ gcc/fortran/intrinsic.c	(working copy)
@@ -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,
Index: libgfortran/ieee/ieee_arithmetic.F90
===
--- libgfortran/ieee/ieee_arithmetic.F90	(revision 240039)
+++ libgfortran/ieee/ieee_arithmetic.F90	(working copy)
@@ -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)
Index: gcc/testsuite/gfortran.dg/pr77507.f90
===
--- gcc/testsuite/gfortran.dg/pr77507.f90	(nonexistent)
+++ gcc/testsuite/gfortran.dg/pr77507.f90	(working copy)
@@ -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