From: Fritz Reese Date: Tue, 11 Oct 2016 18:44:05 +0000 (+0000) Subject: Fix bad commit for -fdec-math. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec08df86cb5af4ab34f8251b38f52be7b99bfa20;p=gcc.git Fix bad commit for -fdec-math. 2016-10-11 Fritz Reese Fix bad commit for -fdec-math. * iresolve.c (get_radians, get_degrees): Fix sloppy commit. * simplify.c (degrees_f, radians_f): Ditto. From-SVN: r241001 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 025bfabb4aa..e9b88686c48 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2016-10-11 Fritz Reese + + * iresolve.c (get_radians, get_degrees): Fix sloppy commit. + * simplify.c (degrees_f, radians_f): Ditto. + 2016-10-11 Jerry DeLisle * simplify.c (radians_f): Fix mpdr_mod. diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c index 4334522c5e6..9ae0b6e2c8e 100644 --- a/gcc/fortran/iresolve.c +++ b/gcc/fortran/iresolve.c @@ -2687,7 +2687,7 @@ get_radians (gfc_expr *deg) /* Set factor = pi / 180. */ factor = gfc_get_constant_expr (deg->ts.type, deg->ts.kind, °->where); mpfr_const_pi (factor->value.real, GFC_RND_MODE); - mpfr_div_d (factor->value.real, factor->value.real, 180.0, GFC_RND_MODE); + mpfr_div_ui (factor->value.real, factor->value.real, 180, GFC_RND_MODE); /* Result is rad = (deg % 360) * (pi / 180). */ result = gfc_multiply (result, factor); @@ -2725,7 +2725,7 @@ get_degrees (gfc_expr *rad) /* Set factor = 180 / pi. */ factor = gfc_get_constant_expr (rad->ts.type, rad->ts.kind, &rad->where); - mpfr_set_d (factor->value.real, 180.0, GFC_RND_MODE); + mpfr_set_ui (factor->value.real, 180, GFC_RND_MODE); mpfr_init (tmp); mpfr_const_pi (tmp, GFC_RND_MODE); mpfr_div (factor->value.real, factor->value.real, tmp, GFC_RND_MODE); diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c index 18135d2f4a2..eb6e41258fb 100644 --- a/gcc/fortran/simplify.c +++ b/gcc/fortran/simplify.c @@ -1754,7 +1754,7 @@ degrees_f (mpfr_t x, mp_rnd_t rnd_mode) mpfr_fmod (tmp, x, tmp, rnd_mode); /* Set x = x * 180. */ - mpfr_mul_d (x, x, 180.0, rnd_mode); + mpfr_mul_ui (x, x, 180, rnd_mode); /* Set x = x / pi. */ mpfr_const_pi (tmp, rnd_mode); @@ -1768,23 +1768,21 @@ degrees_f (mpfr_t x, mp_rnd_t rnd_mode) static void radians_f (mpfr_t x, mp_rnd_t rnd_mode) { - mpfr_t tmp, modtmp; + mpfr_t tmp; mpfr_init (tmp); - mpfr_init (modtmp); /* Set x = x % 360 to avoid offsets with large angles. */ - mpfr_set_d (modtmp, 360.0, GFC_RND_MODE); - mpfr_fmod (tmp, x, modtmp, rnd_mode); + mpfr_set_ui (tmp, 360, rnd_mode); + mpfr_fmod (tmp, x, tmp, rnd_mode); /* Set x = x * pi. */ mpfr_const_pi (tmp, rnd_mode); mpfr_mul (x, x, tmp, rnd_mode); /* Set x = x / 180. */ - mpfr_div_d (x, x, 180.0, rnd_mode); + mpfr_div_ui (x, x, 180, rnd_mode); mpfr_clear (tmp); - mpfr_clear (modtmp); }