summaryrefslogtreecommitdiffstats
path: root/libgfortran/io/write.c
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-05 14:20:10 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-05 14:20:10 +0000
commit796e5f20b61e2b5217c3bd10df4041ee5707bd0f (patch)
treef31db877f1ff6847fae7b39c30d10d28a04bed21 /libgfortran/io/write.c
parent4a5c037c49615199368744b96f399ca51f54c539 (diff)
downloadppe42-gcc-796e5f20b61e2b5217c3bd10df4041ee5707bd0f.tar.gz
ppe42-gcc-796e5f20b61e2b5217c3bd10df4041ee5707bd0f.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97627 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io/write.c')
-rw-r--r--libgfortran/io/write.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c
index 556adea268b..d97caec8bc7 100644
--- a/libgfortran/io/write.c
+++ b/libgfortran/io/write.c
@@ -674,7 +674,7 @@ static void
write_float (fnode *f, const char *source, int len)
{
double n;
- int nb =0, res;
+ int nb =0, res, save_scale_factor;
char * p, fin;
fnode *f2 = NULL;
@@ -723,8 +723,10 @@ write_float (fnode *f, const char *source, int len)
}
else
{
+ save_scale_factor = g.scale_factor;
f2 = calculate_G_format(f, n, len, &nb);
output_float (f2, n, len);
+ g.scale_factor = save_scale_factor;
if (f2 != NULL)
free_mem(f2);
OpenPOWER on IntegriCloud