diff options
author | Janne Blomqvist <jb@gcc.gnu.org> | 2012-03-15 17:14:43 +0200 |
---|---|---|
committer | Janne Blomqvist <jb@gcc.gnu.org> | 2012-03-15 17:14:43 +0200 |
commit | 37b659dd29908f5b5320f15fbe89f5c560d62464 (patch) | |
tree | 45e8784a537c5c9f8f7c86d17a1756db37da6e4c /gcc | |
parent | ff63ac4d66fdcd9e0952b31b5dae947ffc638814 (diff) | |
download | gcc-37b659dd29908f5b5320f15fbe89f5c560d62464.zip gcc-37b659dd29908f5b5320f15fbe89f5c560d62464.tar.gz gcc-37b659dd29908f5b5320f15fbe89f5c560d62464.tar.bz2 |
re PR libfortran/52434 (Insufficient number of digits in floating point formatting)
2012-03-15 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/52434
PR libfortran/48878
PR libfortran/38199
* io/unit.c (get_internal_unit): Default to ROUND_UNSPECIFIED.
(init_units): Likewise.
* io/write_float.def (determine_precision): New function.
(output_float): Take into account buffer with %f format, no need
for our own rounding if unspecified or processor specified
rounding.
(DTOA): Simplify format string, add parameters.
(FDTOA): New macros similar to DTOA, but using %f format.
(OUTPUT_FLOAT_FMT_G): Stack allocate newf, determine correct
precision and fill buffer.
(EN_PREC): New macro.
(determine_en_precision): New function.
(WRITE_FLOAT): For G format, move buffer filling into
output_float_FMT_G, use FDTOA for F format.
(write_float): Increase buffer due to F format.
testsuite ChangeLog:
2012-03-15 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/52434
PR libfortran/48878
PR libfortran/38199
* gfortran.dg/edit_real_1.f90: Don't assume roundTiesToAway.
* gfortran.dg/round_1.f03: Likewise.
From-SVN: r185433
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/edit_real_1.f90 | 2 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/round_1.f03 | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0bcdd03..e7cce39 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2012-03-15 Janne Blomqvist <jb@gcc.gnu.org> + + PR libfortran/52434 + PR libfortran/48878 + PR libfortran/38199 + * gfortran.dg/edit_real_1.f90: Don't assume roundTiesToAway. + * gfortran.dg/round_1.f03: Likewise. + 2012-03-15 Jakub Jelinek <jakub@redhat.com> Andrew Pinski <apinski@cavium.com> diff --git a/gcc/testsuite/gfortran.dg/edit_real_1.f90 b/gcc/testsuite/gfortran.dg/edit_real_1.f90 index 3ac7cb4..594b2f1 100644 --- a/gcc/testsuite/gfortran.dg/edit_real_1.f90 +++ b/gcc/testsuite/gfortran.dg/edit_real_1.f90 @@ -68,7 +68,7 @@ program edit_real_1 if (s .ne. '12.345E-01z') call abort ! E format, negative scale factor s = x - write (s, '(-2PE10.4,A)') 1.25, "z" + write (s, '(-2PE10.4,A)') 1.250001, "z" if (s .ne. '0.0013E+03z') call abort ! E format, single digit precision s = x diff --git a/gcc/testsuite/gfortran.dg/round_1.f03 b/gcc/testsuite/gfortran.dg/round_1.f03 index db5d6ec..f74b137 100644 --- a/gcc/testsuite/gfortran.dg/round_1.f03 +++ b/gcc/testsuite/gfortran.dg/round_1.f03 @@ -20,9 +20,9 @@ write(line, fmt(4)) 1.20, 1.22, 1.25, 1.27, 1.30, 1.125 if (line.ne." 1.20 1.22 1.25 1.27 1.30 1.12") call abort write(line, fmt(5)) 1.20, 1.22, 1.25, 1.27, 1.30, 1.125 if (line.ne." 1.20 1.22 1.25 1.27 1.30 1.13") call abort -write(line, fmt(6)) 1.20, 1.22, 1.25, 1.27, 1.30, 1.125 +write(line, fmt(6)) 1.20, 1.22, 1.250001, 1.27, 1.30, 1.125 if (line.ne." 1.2 1.2 1.3 1.3 1.3 1.1") call abort -write(line, fmt(7)) 1.20, 1.22, 1.25, 1.27, 1.30, 1.125 +write(line, fmt(7)) 1.20, 1.22, 1.250001, 1.27, 1.30, 1.125 if (line.ne." +1.2 +1.2 +1.3 +1.3 +1.3 +1.1") call abort end |