simplify.c (gfc_simplify_rrspacing): Initialize and clear mpfr_t variable.

2006-06-20  Steven G. Kargl  <kargls@comcast.net>

        * simplify.c (gfc_simplify_rrspacing): Initialize and clear mpfr_t
        variable.

        * gfortran.dg/rrspacing_1.f90: New test.

From-SVN: r114821
This commit is contained in:
Steven G. Kargl 2006-06-20 17:49:41 +00:00 committed by Steven G. Kargl
parent 971774e438
commit 0ccff66da6
4 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2006-06-20 Steven G. Kargl <kargls@comcast.net>
* simplify.c (gfc_simplify_rrspacing): Initialize and clear mpfr_t
variable.
2006-06-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/25049

View File

@ -3030,6 +3030,7 @@ gfc_simplify_rrspacing (gfc_expr * x)
mpfr_init (absv);
mpfr_init (frac);
mpfr_init (pow2);
mpfr_init (exp);
mpfr_abs (absv, x->value.real, GFC_RND_MODE);
mpfr_log2 (log2, absv, GFC_RND_MODE);
@ -3046,6 +3047,7 @@ gfc_simplify_rrspacing (gfc_expr * x)
mpfr_clear (absv);
mpfr_clear (frac);
mpfr_clear (pow2);
mpfr_clear (exp);
return range_check (result, "RRSPACING");
}

View File

@ -1,3 +1,8 @@
2006-06-20 Steven G. Kargl <kargls@comcast.net>
* gfortran.dg/rrspacing_1.f90: New test.
2006-06-20 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28052

View File

@ -0,0 +1,8 @@
! { dg-do run }
program m
integer i
real x,y
real, parameter :: a = -3.0
i = int(rrspacing(a))
if (i /= 12582912) call abort
end program m