http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48979
--- Comment #10 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 2011-05-12 20:54:38 UTC --- Forgot the diff Index: simplify.c =================================================================== --- simplify.c (revision 173705) +++ simplify.c (working copy) @@ -2328,6 +2328,14 @@ 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); + if (gfc_option.allow_std & (GFC_STD_F2008|GFC_STD_F2003)) + return result; + return range_check (result, "FRACTION"); + } + if (mpfr_sgn (x->value.real) == 0) { mpfr_set_ui (result->value.real, 0, GFC_RND_MODE);