From: jvdelisle Date: Tue, 25 Nov 2008 05:55:55 +0000 (+0000) Subject: 2008-11-24 Jerry DeLisle X-Git-Tag: upstream/4.9.2~38733 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f32dec7e0b0e0e64c2ee8fc8f4c76bb5b3b691c;p=platform%2Fupstream%2Flinaro-gcc.git 2008-11-24 Jerry DeLisle PR fortran/37803 * arith.c (gfc_check_real_range): Add mpfr_check_range. * simplify.c (gfc_simplify_nearest): Add mpfr_check_range. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142187 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5fe6e9e..a698031 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2008-11-24 Jerry DeLisle + + PR fortran/37803 + * arith.c (gfc_check_real_range): Add mpfr_check_range. + * simplify.c (gfc_simplify_nearest): Add mpfr_check_range. + 2008-11-24 Mikael Morin PR fortran/38184 diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c index c56be03..7440be3 100644 --- a/gcc/fortran/arith.c +++ b/gcc/fortran/arith.c @@ -379,6 +379,7 @@ gfc_check_real_range (mpfr_t p, int kind) en = gfc_real_kinds[i].min_exponent - gfc_real_kinds[i].digits + 1; mpfr_set_emin ((mp_exp_t) en); mpfr_set_emax ((mp_exp_t) gfc_real_kinds[i].max_exponent); + mpfr_check_range (q, 0, GFC_RND_MODE); mpfr_subnormalize (q, 0, GFC_RND_MODE); /* Reset emin and emax. */ diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c index 7922bde..6904960 100644 --- a/gcc/fortran/simplify.c +++ b/gcc/fortran/simplify.c @@ -2993,6 +2993,7 @@ gfc_simplify_nearest (gfc_expr *x, gfc_expr *s) mpfr_set_emin ((mp_exp_t) gfc_real_kinds[kind].min_exponent - mpfr_get_prec(result->value.real) + 1); mpfr_set_emax ((mp_exp_t) gfc_real_kinds[kind].max_exponent - 1); + mpfr_check_range (result->value.real, 0, GMP_RNDU); if (mpfr_sgn (s->value.real) > 0) {