Hi Janne,

On 11/18/19 9:34 PM, Janne Blomqvist wrote:
Now that we require a minimum of MPFR 3.1.0+ to build GCC, we can do
some modernization of the MPFR usage in the GFortran frontend.

OK – thanks for the cleanup.

[For reference, those changes were introduced in MPFR 3.0.0, cf. https://www.mpfr.org/mpfr-3.0.0/#changes ; 3.0 and 3.1 also added a bunch of new functions, MPFR_RNDA and did remove some undefined behaviour.]

Do you intent update the other places as well? Namely:

This patch replaces
1) GMP_RND* with MPFR_RND*
Also used by: configure.ac, gcc/builtins.c, gcc/fold-const-call.c, gcc/gimple-ssa-sprintf.c, gcc/go/…, gcc/real.c, gcc/realmpfr.h, gcc/ubsan.c.

2) mp_exp_t with mpfr_exp_t

gcc/realmpfr.c + gcc/go/…

3) mp_prec_t with mpfr_prec_t
(only used by gcc/fortran)
4) mp_rnd_t with mpfr_rnd_t

gcc/builtins.c, gcc/fold-const-call.c, gcc/realmpfr.c

Cheers,

Tobias

gcc/fortran/ChangeLog:

2019-11-18  Janne Blomqvist  <j...@gcc.gnu.org>

        PR fortran/92463
        * arith.c (gfc_mpfr_to_mpz): Change mp_exp_t to mpfr_exp_t.
        (gfc_check_real_range): Likewise.
        * gfortran.h (GFC_RND_MODE): Change GMP_RNDN to MPFR_RNDN.
        * module.c (mio_gmp_real): Change mp_exp_t to mpfr_exp_t.
        * simplify.c (degrees_f): Change mp_rnd_t to mpfr_rnd_t.
        (radians_f): Likewise.
        (fullprec_erfc_scaled): Change mp_prec_t to mpfr_prec_t.
        (asympt_erfc_scaled): Likewise.
        (gfc_simplify_nearest): Change mp_exp_t to mpfr_exp_t, and
        GMP_RND* to MPFR_RND*.
---
  gcc/fortran/arith.c    |  8 ++++----
  gcc/fortran/gfortran.h |  2 +-
  gcc/fortran/module.c   |  2 +-
  gcc/fortran/simplify.c | 20 ++++++++++----------
  4 files changed, 16 insertions(+), 16 deletions(-)

Reply via email to