diff options
| author | amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-15 20:33:48 +0000 |
|---|---|---|
| committer | amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-15 20:33:48 +0000 |
| commit | 3b688cb80ca0efe6e264a95957758837a67e3faa (patch) | |
| tree | 4b6c4b014ad3dcf5169dd5bdb2c90d41a8cc8596 | |
| parent | c9d8753c393285ea9685bcdc894e4b7588d2a577 (diff) | |
| download | ppe42-gcc-3b688cb80ca0efe6e264a95957758837a67e3faa.tar.gz ppe42-gcc-3b688cb80ca0efe6e264a95957758837a67e3faa.zip | |
PR fortran/24096
* trans-types.c (gfc_init_kinds): Use one less for max_exponent
of IBM extended double format.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107041 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/fortran/trans-types.c | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 0a24084f4cc..7e22961c1db 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2005-11-16 Alan Modra <amodra@bigpond.net.au> + + PR fortran/24096 + * trans-types.c (gfc_init_kinds): Use one less for max_exponent + of IBM extended double format. + 2005-11-13 Francois-Xavier Coudert <coudert@clipper.ens.fr> * intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET, diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index 81a90f1d373..6aaf81a5b4c 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -192,6 +192,15 @@ gfc_init_kinds (void) gfc_real_kinds[r_index].digits = fmt->p; gfc_real_kinds[r_index].min_exponent = fmt->emin; gfc_real_kinds[r_index].max_exponent = fmt->emax; + if (fmt->pnan < fmt->p) + /* This is an IBM extended double format (or the MIPS variant) + made up of two IEEE doubles. The value of the long double is + the sum of the values of the two parts. The most significant + part is required to be the value of the long double rounded + to the nearest double. If we use emax of 1024 then we can't + represent huge(x) = (1 - b**(-p)) * b**(emax-1) * b, because + rounding will make the most significant part overflow. */ + gfc_real_kinds[r_index].max_exponent = fmt->emax - 1; gfc_real_kinds[r_index].mode_precision = GET_MODE_PRECISION (mode); r_index += 1; } |

