summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2016-09-20 21:49:12 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2016-09-20 21:49:12 +0000
commitc9c81ef3c667aaa14c498a5449ec6d134b4b66ff (patch)
tree0ac440db6513ee01deb5e5dc6142769d1e5b7b2d /libgfortran
parent12cdcb9d74f55c165366ca1b1eeec013a0ce72ef (diff)
parent891196d7325e4c55d92d5ac5cfe7161c4f36c0ce (diff)
downloadgcc-fortran-dev.tar.gz
Merge from trunk (r239915 to r240230)fortran-dev
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/fortran-dev@240290 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog13
-rw-r--r--libgfortran/ieee/ieee_arithmetic.F9033
-rw-r--r--libgfortran/io/write_float.def7
3 files changed, 37 insertions, 16 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 256805a3db6..6454eaeb826 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,16 @@
+2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ 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 <jvdelisle@gcc.gnu.org>
+
+ 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 <jvdelisle@gcc.gnu.org>
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)
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] = '.';