Jerry DeLisle - [patch, libgfortran] PR30910 ES format not quite right... (original) (raw)
This is the mail archive of the gcc-patches@gcc.gnu.orgmailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
- From: Jerry DeLisle
- To: Fortran List
- Cc: gcc-patches
- Date: Thu, 22 Feb 2007 19:41:31 -0800
- Subject: [patch, libgfortran] PR30910 ES format not quite right...
Hello all,This trivial patch fixes this problem by only applying the special case for F format specifiers. I have updated the test case within the patch. Thanks to Tobias for tracking in on this.Regression tested on x86-64-Gnu/Linux.OK for Trunk and then 4.2? What about 4.1?Regards,Jerry2007-02-22 Jerry DeLisle jvdelisle@gcc.gnu.org
PR libgfortran/30910
* io/write.c (output_float): Add condition of format F only for
special case rounding with zero precision.
Index: libgfortran/io/write.c
--- libgfortran/io/write.c (revision 122189) +++ libgfortran/io/write.c (working copy) @@ -488,7 +488,7 @@ output_float (st_parameter_dt dtp, cons value = -value; / Special case when format specifies no digits after the decimal point. */ - if (d == 0) + if (d == 0 && ft == FMT_F) { if (value < 0.5) value = 0.0; Index: gcc/testsuite/gfortran.dg/fmt_zero_precision.f90
--- gcc/testsuite/gfortran.dg/fmt_zero_precision.f90 (revision 122189) +++ gcc/testsuite/gfortran.dg/fmt_zero_precision.f90 (working copy) @@ -15,6 +15,35 @@ write(*,100) 333.499 50 format(f3.0,"<") 100 format(f8.0,"<")
- write(6,'(es6.0)') 1.0e-1
- write(*,150) -0.99999
- write(*,150) 0.99999
- write(*,150) -9.0
- write(*,150) -0.99
- write(*,150) -0.999
- write(*,150) -0.999
- write(*,150) -0.59
- write(*,150) -0.49
- write(*,200) 37.99999
- write(*,200) 10345.0
- write(*,200) 333.678
- write(*,200) 333.499
- 150 format(es7.0,"<")
- 200 format(es8.0,"<")
- write(*,250) -0.99999
- write(*,250) 0.99999
- write(*,250) -9.0
- write(*,250) -0.99
- write(*,250) -0.999
- write(*,250) -0.999
- write(*,250) -0.59
- write(*,250) -0.49
- write(*,300) 37.99999
- write(*,300) 10345.0
- write(*,300) 333.678
- write(*,300) 333.499
- 250 format(1pe7.0,"<")
- 300 format(1pe6.0,"<") end ! {dg-output "-1.<" ! {dg-output " 1.<" @@ -28,3 +57,28 @@ ! {dg-output " 10345.<" ! {dg-output " 334.<" ! {dg-output " 333.<" +! {dg-output "1.E-01" +! {dg-output "-1.E+00<" +! {dg-output " 1.E+00<" +! {dg-output "-9.E+00<" +! {dg-output "-1.E+00<" +! {dg-output "-1.E+00<" +! {dg-output "-1.E+00<" +! {dg-output "-6.E-01<" +! {dg-output "-5.E-01<" +! {dg-output " 4.E+01<" +! {dg-output " 1.E+04<" +! {dg-output " 3.E+02<" +! {dg-output " 3.E+02<" +! {dg-output "-1.E+00<" +! {dg-output " 1.E+00<" +! {dg-output "-9.E+00<" +! {dg-output "-1.E+00<" +! {dg-output "-1.E+00<" +! {dg-output "-1.E+00<" +! {dg-output "-6.E-01<" +! {dg-output "-5.E-01<" +! {dg-output "4.E+01<" +! {dg-output "1.E+04<" +! {dg-output "3.E+02<" +! {dg-output "3.E+02<"
- Follow-Ups:
- Re: [patch, libgfortran] PR30910 ES format not quite right...
* From: Steve Kargl
- Re: [patch, libgfortran] PR30910 ES format not quite right...
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |