From 2cbcdebaf9da99f581c309564fc5e458c8725d47 Mon Sep 17 00:00:00 2001 From: Paul Brook Date: Wed, 10 Nov 2004 02:19:27 +0000 Subject: re PR fortran/18218 (Miscompare in sixtrack benchmark caused by loss of precision) PR fortran/18218 * configure.ac: Check for strtof. * configure: Regenerate. * config.h.in: Regenerate. * io/read.c (convert_real): Use strtof if available. (convert_precision_real): Remove. (read_f): Avoid poor exponentiation algorithm. gcc/testsuite/ * gfortran.dg/list_read.c: New test. From-SVN: r90382 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/read_float_1.f90 | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/read_float_1.f90 (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index df1eaa3..ce5a2b1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-11-10 Paul Brook + + PR fortran/18218 + * gfortran.dg/list_read.c: New test. + 2004-11-09 Joseph S. Myers PR c/18322 diff --git a/gcc/testsuite/gfortran.dg/read_float_1.f90 b/gcc/testsuite/gfortran.dg/read_float_1.f90 new file mode 100644 index 0000000..e38036f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/read_float_1.f90 @@ -0,0 +1,12 @@ +! { dg-do run } +! PR18218 +! The IO library has an algorithm that involved repeated multiplication by 10, +! resulting in introducing large cumulative floating point errors. +program foo + character*20 s + real*8 d + s = "-.18774312893273 " + read(unit=s, fmt='(g20.14)') d + if (d + 0.18774312893273d0 .gt. 1d-13) call abort +end program + -- cgit v1.1