[PATCH, committed] Fix constant folding in rrspacing

Steve Kargl sgk@troutmask.apl.washington.edu
Tue Jun 20 18:29:00 GMT 2006


I've committed the following patch to trunk under the
"obviously correct" rule.

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.


Index: simplify.c
===================================================================
--- simplify.c	(revision 114821)
+++ simplify.c	(working copy)
@@ -3011,6 +3011,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);
@@ -3027,6 +3028,7 @@ gfc_simplify_rrspacing (gfc_expr * x)
   mpfr_clear (absv);
   mpfr_clear (frac);
   mpfr_clear (pow2);
+  mpfr_clear (exp);
 
   return range_check (result, "RRSPACING");
 }

-- 
Steve



More information about the Gcc-patches mailing list