aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/simplify.c
diff options
context:
space:
mode:
authorSteven G. Kargl <kargls@comcast.net>2005-04-14 16:29:31 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2005-04-14 16:29:31 +0000
commit2d0aa65f1e2fc95e857bc1ad1e11beee44219ba8 (patch)
tree91ef8649fbc7ae8aff33dfc61c5c29331b64cf22 /gcc/fortran/simplify.c
parent6cecb0aa9673e3dcbb45de4d8050674f405dc958 (diff)
downloadgcc-2d0aa65f1e2fc95e857bc1ad1e11beee44219ba8.zip
gcc-2d0aa65f1e2fc95e857bc1ad1e11beee44219ba8.tar.gz
gcc-2d0aa65f1e2fc95e857bc1ad1e11beee44219ba8.tar.bz2
gfortran.h (gfc_real_info): Add subnormal struct member.
* gfortran.h (gfc_real_info): Add subnormal struct member. * arith.c (gfc_arith_init_1): Set it. (gfc_check_real_range): Use it. * simplify.c (gfc_simplify_nearest): Fix nearest(0.,1.). From-SVN: r98141
Diffstat (limited to 'gcc/fortran/simplify.c')
-rw-r--r--gcc/fortran/simplify.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 8f9f9e4..fa6c2c6 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -2293,21 +2293,10 @@ gfc_simplify_nearest (gfc_expr * x, gfc_expr * s)
if (direction > 0)
mpfr_add (result->value.real,
- x->value.real, gfc_real_kinds[k].tiny, GFC_RND_MODE);
+ x->value.real, gfc_real_kinds[k].subnormal, GFC_RND_MODE);
else
mpfr_sub (result->value.real,
- x->value.real, gfc_real_kinds[k].tiny, GFC_RND_MODE);
-
-#if 0
- /* FIXME: This gives an arithmetic error because we compare
- against tiny when range-checking. Also, it doesn't give the
- right value. */
- /* TINY is the smallest model number, we want the smallest
- machine representable number. Therefore we have to shift the
- value to the right by the number of digits - 1. */
- mpfr_div_2ui (result->value.real, result->value.real,
- gfc_real_kinds[k].precision - 1, GFC_RND_MODE);
-#endif
+ x->value.real, gfc_real_kinds[k].subnormal, GFC_RND_MODE);
}
else
{