From 45b4ec58102b53a056b5a84eb27ab8bc64cb6525 Mon Sep 17 00:00:00 2001 From: jvdelisle Date: Tue, 6 Sep 2016 23:22:26 +0000 Subject: 2016-09-06 Jerry DeLisle PR libgfortran/77393 * io/write_float.def (build_float_string): Recognize when the result will not fit in the user provided, star fill, and exit early. * gfortran.dg/fmt_f0_2.f90: Update test. * gfortran.dg/fmt_f0_3.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240018 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgfortran/ChangeLog | 7 +++++++ libgfortran/io/write_float.def | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'libgfortran') diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 256805a3db6..f9ed4b013a4 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,10 @@ +2016-09-16 Jerry DeLisle + + PR libgfortran/77393 + * io/write_float.def (build_float_string): Recognize when the + result will not fit in the user provided, star fill, and exit + early. + 2016-08-31 Jerry DeLisle PR libgfortran/77393 diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def index 04223c043a3..504482fa170 100644 --- a/libgfortran/io/write_float.def +++ b/libgfortran/io/write_float.def @@ -174,6 +174,13 @@ build_float_string (st_parameter_dt *dtp, const fnode *f, char *buffer, { case FMT_F: nbefore = ndigits - precision; + if ((w > 0) && (nbefore > (int) size)) + { + *len = w; + star_fill (result, w); + result[w] = '\0'; + return; + } /* Make sure the decimal point is a '.'; depending on the locale, this might not be the case otherwise. */ digits[nbefore] = '.'; -- cgit v1.2.1 From 7d4820493cc34afcb8ff9b0203dc4d6898193102 Mon Sep 17 00:00:00 2001 From: jvdelisle Date: Tue, 6 Sep 2016 23:22:36 +0000 Subject: Fix dates on changelog git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240019 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgfortran/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libgfortran') diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index f9ed4b013a4..b445cd0f848 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,4 +1,4 @@ -2016-09-16 Jerry DeLisle +2016-09-06 Jerry DeLisle PR libgfortran/77393 * io/write_float.def (build_float_string): Recognize when the -- cgit v1.2.1 From 374777a4c84c0a76f5dc7c4db88369b958a8cb6d Mon Sep 17 00:00:00 2001 From: kargl Date: Fri, 9 Sep 2016 17:57:11 +0000 Subject: 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240050 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgfortran/ChangeLog | 6 ++++++ libgfortran/ieee/ieee_arithmetic.F90 | 33 +++++++++++++++++---------------- 2 files changed, 23 insertions(+), 16 deletions(-) (limited to 'libgfortran') 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) -- cgit v1.2.1