]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0
authorTobias Burnus <burnus@gcc.gnu.org>
Wed, 27 Nov 2019 09:16:24 +0000 (10:16 +0100)
committerTobias Burnus <burnus@gcc.gnu.org>
Wed, 27 Nov 2019 09:16:24 +0000 (10:16 +0100)
        PR middle-end/92463
        * configure.ac: Use MPFR_RNDN instead of GMP's MP_RNDN.
        * configure: Regenerate

        gcc/
        PR middle-end/92463
        * builtins.c (do_mpfr_ckconv, do_mpc_ckconv, do_mpfr_remquo,
        do_mpfr_lgamma_r, do_mpc_arg2): Use MPFR_RNDx instead of GMP_RNDx,
        mpfr_rnd_t instead of mp_rnd_t.
        * fold-const-call.c (do_mpfr_ckconv, do_mpfr_arg1, do_mpfr_sincos,
        do_mpfr_arg2, do_mpfr_arg3, do_mpc_arg1, do_mpc_arg2): Likewise.
        * gimple-ssa-sprintf.c (format_floating_max, format_floating):
        Use mpfr_exp_t instead of mp_exp_t.
        * real.c (real_from_string, dconst_e_ptr, dconst_sqrt2_ptr): Use
        MPFR_RNDx instead of GMP_RNDx.
        * realmpfr.c (real_from_mpfr, mpfr_from_real): Use mpfr_rnd_t and
        mpfr_exp_t instead mp_rnd_t and mp_exp_t, respectively.
        * realmpfr.h (real_from_mpfr, mpfr_from_real): Use mpfr_rnd_t instead
        of mp_rnd_t and remove MPFR_RNDx poisoning.
        * ubsan.c (ubsan_instrument_float_cast): MPFR_RNDx instead of GMP_RNDx.

        fortran/
        PR middle-end/92463
        * arith.c (gfc_check_real_range): Replace mp_exp_t by mpfr_exp_t.

From-SVN: r278761

13 files changed:
ChangeLog
configure
configure.ac
gcc/ChangeLog
gcc/builtins.c
gcc/fold-const-call.c
gcc/fortran/ChangeLog
gcc/fortran/arith.c
gcc/gimple-ssa-sprintf.c
gcc/real.c
gcc/realmpfr.c
gcc/realmpfr.h
gcc/ubsan.c

index 47672e4fae6c3fba68785345737ddb0244f2a0cc..cedd89b9be88da4c09e47f9c9b9f675b5fb2317f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-11-27  Tobias Burnus  <tobias@codesourcery.com>
+
+       PR middle-end/92463
+       * configure.ac: Use MPFR_RNDN instead of GMP's MP_RNDN.
+       * configure: Regenerate
+
 2019-11-20  Janne Blomqvist  <jb@gcc.gnu.org>
 
        * configure.ac: Use https for gcc.gnu.org.
@@ -14,9 +20,9 @@
 
 2019-11-11  Janne Blomqvist  <jb@gcc.gnu.org>
 
-        PR fortran/91828
-        * configure.ac: Bump minimum MPFR to 3.1.0, recommended to 3.1.6+.
-        * configure: Regenerated.
+       PR fortran/91828
+       * configure.ac: Bump minimum MPFR to 3.1.0, recommended to 3.1.6+.
+       * configure: Regenerated.
 
 2019-10-21  Jason Merrill  <jason@redhat.com>
 
index 00f7487e2e9789697a785518c8da8932af307aec..f6027397cedd5c28cd821a0bc7629d6537393ecf 100755 (executable)
--- a/configure
+++ b/configure
@@ -5865,9 +5865,9 @@ main ()
     int t;
     mpfr_init (n);
     mpfr_init (x);
-    mpfr_atan2 (n, n, x, GMP_RNDN);
-    mpfr_erfc (n, x, GMP_RNDN);
-    mpfr_subnormalize (x, t, GMP_RNDN);
+    mpfr_atan2 (n, n, x, MPFR_RNDN);
+    mpfr_erfc (n, x, MPFR_RNDN);
+    mpfr_subnormalize (x, t, MPFR_RNDN);
     mpfr_clear(n);
     mpfr_clear(x);
     mpc_init2 (c, 53);
index 29e25f13278871a7ff94feafb638db42f1f9562a..50e2fa135b10486170f68ffa162dcbeee2adff90 100644 (file)
@@ -1641,9 +1641,9 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then
     int t;
     mpfr_init (n);
     mpfr_init (x);
-    mpfr_atan2 (n, n, x, GMP_RNDN);
-    mpfr_erfc (n, x, GMP_RNDN);
-    mpfr_subnormalize (x, t, GMP_RNDN);
+    mpfr_atan2 (n, n, x, MPFR_RNDN);
+    mpfr_erfc (n, x, MPFR_RNDN);
+    mpfr_subnormalize (x, t, MPFR_RNDN);
     mpfr_clear(n);
     mpfr_clear(x);
     mpc_init2 (c, 53);
index 78b2f46c2d9ff682ecb6272a4f182402a4eebb05..d46ba4cbc4e2aee07df3c3244969d9438380adbe 100644 (file)
@@ -1,3 +1,21 @@
+2019-11-27  Tobias Burnus  <tobias@codesourcery.com>
+
+       PR middle-end/92463
+       * builtins.c (do_mpfr_ckconv, do_mpc_ckconv, do_mpfr_remquo,
+       do_mpfr_lgamma_r, do_mpc_arg2): Use MPFR_RNDx instead of GMP_RNDx,
+       mpfr_rnd_t instead of mp_rnd_t.
+       * fold-const-call.c (do_mpfr_ckconv, do_mpfr_arg1, do_mpfr_sincos,
+       do_mpfr_arg2, do_mpfr_arg3, do_mpc_arg1, do_mpc_arg2): Likewise.
+       * gimple-ssa-sprintf.c (format_floating_max, format_floating):
+       Use mpfr_exp_t instead of mp_exp_t.
+       * real.c (real_from_string, dconst_e_ptr, dconst_sqrt2_ptr): Use
+       MPFR_RNDx instead of GMP_RNDx.
+       * realmpfr.c (real_from_mpfr, mpfr_from_real): Use mpfr_rnd_t and
+       mpfr_exp_t instead mp_rnd_t and mp_exp_t, respectively.
+       * realmpfr.h (real_from_mpfr, mpfr_from_real): Use mpfr_rnd_t instead
+       of mp_rnd_t and remove MPFR_RNDx poisoning.
+       * ubsan.c (ubsan_instrument_float_cast): MPFR_RNDx instead of GMP_RNDx.
+
 2019-11-27  Kewen Lin  <linkw@gcc.gnu.org>
 
        PR tree-optimization/91790
index 8296d84617166223b92e02e79130600b969ebd3b..36319a97b52271849d8fb7f6e34deb501575e237 100644 (file)
@@ -11045,7 +11045,7 @@ do_mpfr_ckconv (mpfr_srcptr m, tree type, int inexact)
     {
       REAL_VALUE_TYPE rr;
 
-      real_from_mpfr (&rr, m, type, GMP_RNDN);
+      real_from_mpfr (&rr, m, type, MPFR_RNDN);
       /* Proceed iff GCC's REAL_VALUE_TYPE can hold the MPFR value,
         check for overflow/underflow.  If the REAL_VALUE_TYPE is zero
         but the mpft_t is not, then we underflowed in the
@@ -11085,8 +11085,8 @@ do_mpc_ckconv (mpc_srcptr m, tree type, int inexact, int force_convert)
     {
       REAL_VALUE_TYPE re, im;
 
-      real_from_mpfr (&re, mpc_realref (m), TREE_TYPE (type), GMP_RNDN);
-      real_from_mpfr (&im, mpc_imagref (m), TREE_TYPE (type), GMP_RNDN);
+      real_from_mpfr (&re, mpc_realref (m), TREE_TYPE (type), MPFR_RNDN);
+      real_from_mpfr (&im, mpc_imagref (m), TREE_TYPE (type), MPFR_RNDN);
       /* Proceed iff GCC's REAL_VALUE_TYPE can hold the MPFR values,
         check for overflow/underflow.  If the REAL_VALUE_TYPE is zero
         but the mpft_t is not, then we underflowed in the
@@ -11138,14 +11138,14 @@ do_mpfr_remquo (tree arg0, tree arg1, tree arg_quo)
         {
          const struct real_format *fmt = REAL_MODE_FORMAT (TYPE_MODE (type));
          const int prec = fmt->p;
-         const mp_rnd_t rnd = fmt->round_towards_zero? GMP_RNDZ : GMP_RNDN;
+         const mpfr_rnd_t rnd = fmt->round_towards_zero? MPFR_RNDZ : MPFR_RNDN;
          tree result_rem;
          long integer_quo;
          mpfr_t m0, m1;
 
          mpfr_inits2 (prec, m0, m1, NULL);
-         mpfr_from_real (m0, ra0, GMP_RNDN);
-         mpfr_from_real (m1, ra1, GMP_RNDN);
+         mpfr_from_real (m0, ra0, MPFR_RNDN);
+         mpfr_from_real (m1, ra1, MPFR_RNDN);
          mpfr_clear_flags ();
          mpfr_remquo (m0, &integer_quo, m0, m1, rnd);
          /* Remquo is independent of the rounding mode, so pass
@@ -11218,13 +11218,13 @@ do_mpfr_lgamma_r (tree arg, tree arg_sg, tree type)
         {
          const struct real_format *fmt = REAL_MODE_FORMAT (TYPE_MODE (type));
          const int prec = fmt->p;
-         const mp_rnd_t rnd = fmt->round_towards_zero? GMP_RNDZ : GMP_RNDN;
+         const mpfr_rnd_t rnd = fmt->round_towards_zero? MPFR_RNDZ : MPFR_RNDN;
          int inexact, sg;
          mpfr_t m;
          tree result_lg;
 
          mpfr_init2 (m, prec);
-         mpfr_from_real (m, ra, GMP_RNDN);
+         mpfr_from_real (m, ra, MPFR_RNDN);
          mpfr_clear_flags ();
          inexact = mpfr_lgamma (m, &sg, m, rnd);
          result_lg = do_mpfr_ckconv (m, type, inexact);
@@ -11287,7 +11287,8 @@ do_mpc_arg2 (tree arg0, tree arg1, tree type, int do_nonfinite,
          const struct real_format *const fmt =
            REAL_MODE_FORMAT (TYPE_MODE (TREE_TYPE (type)));
          const int prec = fmt->p;
-         const mp_rnd_t rnd = fmt->round_towards_zero ? GMP_RNDZ : GMP_RNDN;
+         const mpfr_rnd_t rnd = fmt->round_towards_zero
+                                ? MPFR_RNDZ : MPFR_RNDN;
          const mpc_rnd_t crnd = fmt->round_towards_zero ? MPC_RNDZZ : MPC_RNDNN;
          int inexact;
          mpc_t m0, m1;
index 3a14d2a41c1521e49edbb396eb02c24fc49c53ee..c4f52fb3c1576c3f205326c1024f4579a4ac5378 100644 (file)
@@ -99,7 +99,7 @@ do_mpfr_ckconv (real_value *result, mpfr_srcptr m, bool inexact,
     return false;
 
   REAL_VALUE_TYPE tmp;
-  real_from_mpfr (&tmp, m, format, GMP_RNDN);
+  real_from_mpfr (&tmp, m, format, MPFR_RNDN);
 
   /* Proceed iff GCC's REAL_VALUE_TYPE can hold the MPFR values.
      If the REAL_VALUE_TYPE is zero but the mpft_t is not, then we
@@ -130,11 +130,11 @@ do_mpfr_arg1 (real_value *result,
     return false;
 
   int prec = format->p;
-  mp_rnd_t rnd = format->round_towards_zero ? GMP_RNDZ : GMP_RNDN;
+  mpfr_rnd_t rnd = format->round_towards_zero ? MPFR_RNDZ : MPFR_RNDN;
   mpfr_t m;
 
   mpfr_init2 (m, prec);
-  mpfr_from_real (m, arg, GMP_RNDN);
+  mpfr_from_real (m, arg, MPFR_RNDN);
   mpfr_clear_flags ();
   bool inexact = func (m, m, rnd);
   bool ok = do_mpfr_ckconv (result, m, inexact, format);
@@ -160,11 +160,11 @@ do_mpfr_sincos (real_value *result_sin, real_value *result_cos,
     return false;
 
   int prec = format->p;
-  mp_rnd_t rnd = format->round_towards_zero ? GMP_RNDZ : GMP_RNDN;
+  mpfr_rnd_t rnd = format->round_towards_zero ? MPFR_RNDZ : MPFR_RNDN;
   mpfr_t m, ms, mc;
 
   mpfr_inits2 (prec, m, ms, mc, NULL);
-  mpfr_from_real (m, arg, GMP_RNDN);
+  mpfr_from_real (m, arg, MPFR_RNDN);
   mpfr_clear_flags ();
   bool inexact = mpfr_sin_cos (ms, mc, m, rnd);
   bool ok = (do_mpfr_ckconv (result_sin, ms, inexact, format)
@@ -193,12 +193,12 @@ do_mpfr_arg2 (real_value *result,
     return false;
 
   int prec = format->p;
-  mp_rnd_t rnd = format->round_towards_zero ? GMP_RNDZ : GMP_RNDN;
+  mpfr_rnd_t rnd = format->round_towards_zero ? MPFR_RNDZ : MPFR_RNDN;
   mpfr_t m0, m1;
 
   mpfr_inits2 (prec, m0, m1, NULL);
-  mpfr_from_real (m0, arg0, GMP_RNDN);
-  mpfr_from_real (m1, arg1, GMP_RNDN);
+  mpfr_from_real (m0, arg0, MPFR_RNDN);
+  mpfr_from_real (m1, arg1, MPFR_RNDN);
   mpfr_clear_flags ();
   bool inexact = func (m0, m0, m1, rnd);
   bool ok = do_mpfr_ckconv (result, m0, inexact, format);
@@ -216,7 +216,7 @@ do_mpfr_arg2 (real_value *result,
 
 static bool
 do_mpfr_arg2 (real_value *result,
-             int (*func) (mpfr_ptr, long, mpfr_srcptr, mp_rnd_t),
+             int (*func) (mpfr_ptr, long, mpfr_srcptr, mpfr_rnd_t),
              const wide_int_ref &arg0, const real_value *arg1,
              const real_format *format)
 {
@@ -224,11 +224,11 @@ do_mpfr_arg2 (real_value *result,
     return false;
 
   int prec = format->p;
-  mp_rnd_t rnd = format->round_towards_zero ? GMP_RNDZ : GMP_RNDN;
+  mpfr_rnd_t rnd = format->round_towards_zero ? MPFR_RNDZ : MPFR_RNDN;
   mpfr_t m;
 
   mpfr_init2 (m, prec);
-  mpfr_from_real (m, arg1, GMP_RNDN);
+  mpfr_from_real (m, arg1, MPFR_RNDN);
   mpfr_clear_flags ();
   bool inexact = func (m, arg0.to_shwi (), m, rnd);
   bool ok = do_mpfr_ckconv (result, m, inexact, format);
@@ -260,13 +260,13 @@ do_mpfr_arg3 (real_value *result,
     return false;
 
   int prec = format->p;
-  mp_rnd_t rnd = format->round_towards_zero ? GMP_RNDZ : GMP_RNDN;
+  mpfr_rnd_t rnd = format->round_towards_zero ? MPFR_RNDZ : MPFR_RNDN;
   mpfr_t m0, m1, m2;
 
   mpfr_inits2 (prec, m0, m1, m2, NULL);
-  mpfr_from_real (m0, arg0, GMP_RNDN);
-  mpfr_from_real (m1, arg1, GMP_RNDN);
-  mpfr_from_real (m2, arg2, GMP_RNDN);
+  mpfr_from_real (m0, arg0, MPFR_RNDN);
+  mpfr_from_real (m1, arg1, MPFR_RNDN);
+  mpfr_from_real (m2, arg2, MPFR_RNDN);
   mpfr_clear_flags ();
   bool inexact = func (m0, m0, m1, m2, rnd);
   bool ok = do_mpfr_ckconv (result, m0, inexact, format);
@@ -296,8 +296,8 @@ do_mpc_ckconv (real_value *result_real, real_value *result_imag,
     return false;
 
   REAL_VALUE_TYPE tmp_real, tmp_imag;
-  real_from_mpfr (&tmp_real, mpc_realref (m), format, GMP_RNDN);
-  real_from_mpfr (&tmp_imag, mpc_imagref (m), format, GMP_RNDN);
+  real_from_mpfr (&tmp_real, mpc_realref (m), format, MPFR_RNDN);
+  real_from_mpfr (&tmp_imag, mpc_imagref (m), format, MPFR_RNDN);
 
   /* Proceed iff GCC's REAL_VALUE_TYPE can hold the MPFR values.
      If the REAL_VALUE_TYPE is zero but the mpft_t is not, then we
@@ -341,8 +341,8 @@ do_mpc_arg1 (real_value *result_real, real_value *result_imag,
   mpc_t m;
 
   mpc_init2 (m, prec);
-  mpfr_from_real (mpc_realref (m), arg_real, GMP_RNDN);
-  mpfr_from_real (mpc_imagref (m), arg_imag, GMP_RNDN);
+  mpfr_from_real (mpc_realref (m), arg_real, MPFR_RNDN);
+  mpfr_from_real (mpc_imagref (m), arg_imag, MPFR_RNDN);
   mpfr_clear_flags ();
   bool inexact = func (m, m, crnd);
   bool ok = do_mpc_ckconv (result_real, result_imag, m, inexact, format);
@@ -378,10 +378,10 @@ do_mpc_arg2 (real_value *result_real, real_value *result_imag,
 
   mpc_init2 (m0, prec);
   mpc_init2 (m1, prec);
-  mpfr_from_real (mpc_realref (m0), arg0_real, GMP_RNDN);
-  mpfr_from_real (mpc_imagref (m0), arg0_imag, GMP_RNDN);
-  mpfr_from_real (mpc_realref (m1), arg1_real, GMP_RNDN);
-  mpfr_from_real (mpc_imagref (m1), arg1_imag, GMP_RNDN);
+  mpfr_from_real (mpc_realref (m0), arg0_real, MPFR_RNDN);
+  mpfr_from_real (mpc_imagref (m0), arg0_imag, MPFR_RNDN);
+  mpfr_from_real (mpc_realref (m1), arg1_real, MPFR_RNDN);
+  mpfr_from_real (mpc_imagref (m1), arg1_imag, MPFR_RNDN);
   mpfr_clear_flags ();
   bool inexact = func (m0, m0, m1, crnd);
   bool ok = do_mpc_ckconv (result_real, result_imag, m0, inexact, format);
index 71aacd25caa97f72b47600b542926f3110173d5f..25252501b1921dca16455665d475a59cf24703d8 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-27  Tobias Burnus  <tobias@codesourcery.com>
+
+       PR middle-end/92463
+       * arith.c (gfc_check_real_range): Replace mp_exp_t by mpfr_exp_t.
+
 2019-11-25  Harald Anlauf  <anlauf@gmx.de>
 
        PR fortran/92629
index cf48077970927f4d7b9555d1918645340d778bff..7f048da95830f3dacacf7f242f7eeb5bfb149bf5 100644 (file)
@@ -385,8 +385,8 @@ gfc_check_real_range (mpfr_t p, int kind)
 
       /* Set emin and emax for the current model number.  */
       en = gfc_real_kinds[i].min_exponent - gfc_real_kinds[i].digits + 1;
-      mpfr_set_emin ((mp_exp_t) en);
-      mpfr_set_emax ((mp_exp_t) gfc_real_kinds[i].max_exponent);
+      mpfr_set_emin ((mpfr_exp_t) en);
+      mpfr_set_emax ((mpfr_exp_t) gfc_real_kinds[i].max_exponent);
       mpfr_check_range (q, 0, GFC_RND_MODE);
       mpfr_subnormalize (q, 0, GFC_RND_MODE);
 
index 804a08675872ccfacdac59f8e08f8a25b6788437..2bbb2b37ac3eee3e28319ab5b555804a842bb68e 100644 (file)
@@ -1606,7 +1606,7 @@ format_floating_max (tree type, char spec, HOST_WIDE_INT prec)
      round-to-nearest mode.  */
   mpfr_t x;
   mpfr_init2 (x, rfmt->p);
-  mpfr_from_real (x, &rv, GMP_RNDN);
+  mpfr_from_real (x, &rv, MPFR_RNDN);
 
   /* Return a value one greater to account for the leading minus sign.  */
   unsigned HOST_WIDE_INT r
@@ -1953,7 +1953,7 @@ format_floating (const directive &dir, tree arg, const vr_values *)
           rounding in either direction can result in longer output.  */
        mpfr_t mpfrval;
        mpfr_init2 (mpfrval, rfmt->p);
-       mpfr_from_real (mpfrval, rvp, i ? GMP_RNDU : GMP_RNDD);
+       mpfr_from_real (mpfrval, rvp, i ? MPFR_RNDU : MPFR_RNDD);
 
        /* Use the MPFR rounding specifier to round down in the first
           iteration and then up.  In most but not all cases this will
index 90067f0087b9dab6ab23775bc68957708e28985a..134240a6be988cc8edaad061ad1b5da87b6900a7 100644 (file)
@@ -2104,7 +2104,7 @@ real_from_string (REAL_VALUE_TYPE *r, const char *str)
 
       /* Nonzero value, possibly overflowing or underflowing.  */
       mpfr_init2 (m, SIGNIFICAND_BITS);
-      inexact = mpfr_strtofr (m, str, NULL, 10, GMP_RNDZ);
+      inexact = mpfr_strtofr (m, str, NULL, 10, MPFR_RNDZ);
       /* The result should never be a NaN, and because the rounding is
         toward zero should never be an infinity.  */
       gcc_assert (!mpfr_nan_p (m) && !mpfr_inf_p (m));
@@ -2120,7 +2120,7 @@ real_from_string (REAL_VALUE_TYPE *r, const char *str)
        }
       else
        {
-         real_from_mpfr (r, m, NULL_TREE, GMP_RNDZ);
+         real_from_mpfr (r, m, NULL_TREE, MPFR_RNDZ);
          /* 1 to 3 bits may have been shifted off (with a sticky bit)
             because the hex digits used in real_from_mpfr did not
             start with a digit 8 to f, but the exponent bounds above
@@ -2431,9 +2431,9 @@ dconst_e_ptr (void)
     {
       mpfr_t m;
       mpfr_init2 (m, SIGNIFICAND_BITS);
-      mpfr_set_ui (m, 1, GMP_RNDN);
-      mpfr_exp (m, m, GMP_RNDN);
-      real_from_mpfr (&value, m, NULL_TREE, GMP_RNDN);
+      mpfr_set_ui (m, 1, MPFR_RNDN);
+      mpfr_exp (m, m, MPFR_RNDN);
+      real_from_mpfr (&value, m, NULL_TREE, MPFR_RNDN);
       mpfr_clear (m);
 
     }
@@ -2474,8 +2474,8 @@ dconst_sqrt2_ptr (void)
     {
       mpfr_t m;
       mpfr_init2 (m, SIGNIFICAND_BITS);
-      mpfr_sqrt_ui (m, 2, GMP_RNDN);
-      real_from_mpfr (&value, m, NULL_TREE, GMP_RNDN);
+      mpfr_sqrt_ui (m, 2, MPFR_RNDN);
+      real_from_mpfr (&value, m, NULL_TREE, MPFR_RNDN);
       mpfr_clear (m);
     }
   return &value;
@@ -5410,13 +5410,13 @@ build_sinatan_real (REAL_VALUE_TYPE * r, tree type)
 
   mpfr_inits (mpfr_const1, mpfr_c, mpfr_maxval, NULL);
 
-  mpfr_from_real (mpfr_const1, &dconst1, GMP_RNDN);
-  mpfr_from_real (mpfr_maxval, &maxval,  GMP_RNDN);
+  mpfr_from_real (mpfr_const1, &dconst1, MPFR_RNDN);
+  mpfr_from_real (mpfr_maxval, &maxval,  MPFR_RNDN);
 
-  mpfr_sub (mpfr_c, mpfr_maxval, mpfr_const1, GMP_RNDN);
-  mpfr_sqrt (mpfr_c, mpfr_c, GMP_RNDZ);
+  mpfr_sub (mpfr_c, mpfr_maxval, mpfr_const1, MPFR_RNDN);
+  mpfr_sqrt (mpfr_c, mpfr_c, MPFR_RNDZ);
 
-  real_from_mpfr (r, mpfr_c, fmt, GMP_RNDZ);
+  real_from_mpfr (r, mpfr_c, fmt, MPFR_RNDZ);
   
   mpfr_clears (mpfr_const1, mpfr_c, mpfr_maxval, NULL);
 }
index 39f9fa1333b30e6f562e3cc5bae2ea437d61a6e5..a760ae124c32a4c95f08771e407e6a47a712d513 100644 (file)
@@ -28,7 +28,7 @@
    for initializing and clearing the MPFR parameter.  */
 
 void
-mpfr_from_real (mpfr_ptr m, const REAL_VALUE_TYPE *r, mp_rnd_t rndmode)
+mpfr_from_real (mpfr_ptr m, const REAL_VALUE_TYPE *r, mpfr_rnd_t rndmode)
 {
   /* We use a string as an intermediate type.  */
   char buf[128];
@@ -59,11 +59,11 @@ mpfr_from_real (mpfr_ptr m, const REAL_VALUE_TYPE *r, mp_rnd_t rndmode)
 
 void
 real_from_mpfr (REAL_VALUE_TYPE *r, mpfr_srcptr m, const real_format *format,
-               mp_rnd_t rndmode)
+               mpfr_rnd_t rndmode)
 {
   /* We use a string as an intermediate type.  */
   char buf[128], *rstr;
-  mp_exp_t exp;
+  mpfr_exp_t exp;
 
   /* Take care of Infinity and NaN.  */
   if (mpfr_inf_p (m))
@@ -105,7 +105,8 @@ real_from_mpfr (REAL_VALUE_TYPE *r, mpfr_srcptr m, const real_format *format,
    mode RNDMODE.  TYPE is only relevant if M is a NaN.  */
 
 void
-real_from_mpfr (REAL_VALUE_TYPE *r, mpfr_srcptr m, tree type, mp_rnd_t rndmode)
+real_from_mpfr (REAL_VALUE_TYPE *r, mpfr_srcptr m, tree type,
+               mpfr_rnd_t rndmode)
 {
   real_from_mpfr (r, m, type ? REAL_MODE_FORMAT (TYPE_MODE (type)) : NULL,
                  rndmode);
index bfea86d2bd92e85e580b826631e273659f22bfdc..ebb44fd859d01e6dce10860252eef4c48aa948d5 100644 (file)
 /* Convert between MPFR and REAL_VALUE_TYPE.  The caller is
    responsible for initializing and clearing the MPFR parameter.  */
 
-extern void real_from_mpfr (REAL_VALUE_TYPE *, mpfr_srcptr, tree, mp_rnd_t);
+extern void real_from_mpfr (REAL_VALUE_TYPE *, mpfr_srcptr, tree, mpfr_rnd_t);
 extern void real_from_mpfr (REAL_VALUE_TYPE *, mpfr_srcptr,
-                           const real_format *, mp_rnd_t);
-extern void mpfr_from_real (mpfr_ptr, const REAL_VALUE_TYPE *, mp_rnd_t);
-
-#if (GCC_VERSION >= 3000)
-  /* For compatibility with mpfr 2.4 and earlier, we want to only use
-     GMP_RND*.  */
-  #pragma GCC poison MPFR_RNDN MPFR_RNDZ MPFR_RNDU MPFR_RNDD
-#endif
+                           const real_format *, mpfr_rnd_t);
+extern void mpfr_from_real (mpfr_ptr, const REAL_VALUE_TYPE *, mpfr_rnd_t);
 
 #endif /* ! GCC_REALGMP_H */
index d2696302bd0b0ef39ba08913eb27796f72143586..f12674b5649e97f254c374ec19af4d77a7c36f89 100644 (file)
@@ -1860,7 +1860,7 @@ ubsan_instrument_float_cast (location_t loc, tree type, tree expr)
         representable decimal number greater or equal than
         1 << (prec - !uns_p).  */
       mpfr_init2 (m, prec + 2);
-      mpfr_set_ui_2exp (m, 1, prec - !uns_p, GMP_RNDN);
+      mpfr_set_ui_2exp (m, 1, prec - !uns_p, MPFR_RNDN);
       mpfr_snprintf (buf, sizeof buf, "%.*RUe", p - 1, m);
       decimal_real_from_string (&maxval, buf);
       max = build_real (expr_type, maxval);
@@ -1873,8 +1873,8 @@ ubsan_instrument_float_cast (location_t loc, tree type, tree expr)
          /* Use mpfr_snprintf rounding to compute the largest
             representable decimal number less or equal than
             (-1 << (prec - 1)) - 1.  */
-         mpfr_set_si_2exp (m, -1, prec - 1, GMP_RNDN);
-         mpfr_sub_ui (m, m, 1, GMP_RNDN);
+         mpfr_set_si_2exp (m, -1, prec - 1, MPFR_RNDN);
+         mpfr_sub_ui (m, m, 1, MPFR_RNDN);
          mpfr_snprintf (buf, sizeof buf, "%.*RDe", p - 1, m);
          decimal_real_from_string (&minval, buf);
          min = build_real (expr_type, minval);