diff options
author | Francois-Xavier Coudert <coudert@clipper.ens.fr> | 2005-07-30 22:45:02 +0200 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2005-07-30 20:45:02 +0000 |
commit | 6d56728a759c9db12b2acd468fd2c1cdc56d7ead (patch) | |
tree | 75f9cf4291054bfca9effb0ae433a2f9c295f57c | |
parent | a4ccc3361445147584c08ae823db1fe5a171d311 (diff) | |
download | gcc-6d56728a759c9db12b2acd468fd2c1cdc56d7ead.zip gcc-6d56728a759c9db12b2acd468fd2c1cdc56d7ead.tar.gz gcc-6d56728a759c9db12b2acd468fd2c1cdc56d7ead.tar.bz2 |
re PR libfortran/22436 (print *,tiny(1._10) yields asterisks)
PR libfortran/22436
* io/write.c (write_real): Add default formats for real(10) and
real(16).
From-SVN: r102590
-rw-r--r-- | libgfortran/ChangeLog | 6 | ||||
-rw-r--r-- | libgfortran/io/write.c | 25 |
2 files changed, 26 insertions, 5 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 84bcc48..55bbfa2 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2005-07-30 Francois-Xavier Coudert <coudert@clipper.ens.fr> + + PR libfortran/22436 + * io/write.c (write_real): Add default formats for real(10) and + real(16). + 2005-07-30 Paul Thomas <pault@gcc.gnu.org> PR fortran/22570 and related issues. diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c index a702de1..6ccf02e 100644 --- a/libgfortran/io/write.c +++ b/libgfortran/io/write.c @@ -1292,7 +1292,8 @@ write_character (const char *source, int length) /* Output a real number with default format. - This is 1PG14.7E2 for REAL(4) and 1PG23.15E3 for REAL(8). */ + This is 1PG14.7E2 for REAL(4), 1PG23.15E3 for REAL(8), + 1PG24.15E4 for REAL(10) and 1PG40.31E4 for REAL(16). */ static void write_real (const char *source, int length) @@ -1301,17 +1302,31 @@ write_real (const char *source, int length) int org_scale = g.scale_factor; f.format = FMT_G; g.scale_factor = 1; - if (length < 8) + switch (length) { + case 4: f.u.real.w = 14; f.u.real.d = 7; f.u.real.e = 2; - } - else - { + break; + case 8: f.u.real.w = 23; f.u.real.d = 15; f.u.real.e = 3; + break; + case 10: + f.u.real.w = 24; + f.u.real.d = 15; + f.u.real.e = 4; + break; + case 16: + f.u.real.w = 40; + f.u.real.d = 31; + f.u.real.e = 4; + break; + default: + internal_error ("bad real kind"); + break; } write_float (&f, source , length); g.scale_factor = org_scale; |