http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48979

--- Comment #7 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 
2011-05-12 20:10:19 UTC ---
Here's a better patch that gets the warning/error
messages correct.

Index: simplify.c
===================================================================
--- simplify.c  (revision 173705)
+++ simplify.c  (working copy)
@@ -2328,6 +2328,12 @@ gfc_simplify_fraction (gfc_expr *x)

   result = gfc_get_constant_expr (BT_REAL, x->ts.kind, &x->where);

+  if (mpfr_nan_p (x->value.real) != 0 || mpfr_inf_p (x->value.real) != 0)
+    {
+      mpfr_set (result->value.real, x->value.real, GFC_RND_MODE);
+      return range_check (result, "FRACTION");
+    }
+
   if (mpfr_sgn (x->value.real) == 0)
     {
       mpfr_set_ui (result->value.real, 0, GFC_RND_MODE);

Reply via email to