mirror of git://gcc.gnu.org/git/gcc.git
re PR libfortran/20755 (gfortran - prints the same number with 1p4G12.3 two different ways)
PR libfortran/20755 * write.c (write_float): A G edit descriptor may locally change the scale factor, but it needs to be restored afterwards. * gfortran.dg/pr20755.f: New test. From-SVN: r97627
This commit is contained in:
parent
9e9126f355
commit
51e9d74cb8
|
|
@ -1,3 +1,8 @@
|
||||||
|
2005-04-05 Francois-Xavier Coudert <coudert@clipper.ens.fr>
|
||||||
|
|
||||||
|
PR libfortran/20755
|
||||||
|
* gfortran.dg/pr20755.f: New test.
|
||||||
|
|
||||||
2005-04-05 Feng Wang <fengwang@nudt.edu.cn>
|
2005-04-05 Feng Wang <fengwang@nudt.edu.cn>
|
||||||
|
|
||||||
* gfortran.dg/pr15959.f90: New test.
|
* gfortran.dg/pr15959.f90: New test.
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
! PR libfortran/20755
|
||||||
|
! { dg-do run }
|
||||||
|
character*30 s
|
||||||
|
|
||||||
|
write (s,2000) 0.0, 0.02
|
||||||
|
if (s .ne. " 0.00 2.000E-02") call abort
|
||||||
|
write (s,2000) 0.01, 0.02
|
||||||
|
if (s .ne. " 1.000E-02 2.000E-02") call abort
|
||||||
|
2000 format (1P2G12.3)
|
||||||
|
end
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
|
2005-04-05 Francois-Xavier Coudert <coudert@clipper.ens.fr>
|
||||||
|
|
||||||
|
PR libfortran/20755
|
||||||
|
* write.c (write_float): A G edit descriptor may locally change
|
||||||
|
the scale factor, but it needs to be restored afterwards.
|
||||||
|
|
||||||
2005-04-03 Dale Ranta <dir@lanl.gov>
|
2005-04-03 Dale Ranta <dir@lanl.gov>
|
||||||
Francois-Xavier Coudert <coudert@clipper.ens.fr>
|
Francois-Xavier Coudert <coudert@clipper.ens.fr>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -674,7 +674,7 @@ static void
|
||||||
write_float (fnode *f, const char *source, int len)
|
write_float (fnode *f, const char *source, int len)
|
||||||
{
|
{
|
||||||
double n;
|
double n;
|
||||||
int nb =0, res;
|
int nb =0, res, save_scale_factor;
|
||||||
char * p, fin;
|
char * p, fin;
|
||||||
fnode *f2 = NULL;
|
fnode *f2 = NULL;
|
||||||
|
|
||||||
|
|
@ -723,8 +723,10 @@ write_float (fnode *f, const char *source, int len)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
save_scale_factor = g.scale_factor;
|
||||||
f2 = calculate_G_format(f, n, len, &nb);
|
f2 = calculate_G_format(f, n, len, &nb);
|
||||||
output_float (f2, n, len);
|
output_float (f2, n, len);
|
||||||
|
g.scale_factor = save_scale_factor;
|
||||||
if (f2 != NULL)
|
if (f2 != NULL)
|
||||||
free_mem(f2);
|
free_mem(f2);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue