Commit 8be34204 by Janne Blomqvist

Bump minimum MPFR version to 3.1.0

Bump the minimum MPFR version to 3.1.0, released 2011-10-03. With this
requirement one can still build GCC with the operating system provided
MPFR on old but still supported operating systems like SLES 12 (MPFR
3.1.2) or RHEL/CentOS 7.x (MPFR 3.1.1).

This allows removing some code in the Fortran frontend, as well as
fixing PR 91828.

ChangeLog:

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.

gcc/ChangeLog:

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

	PR fortran/91828
	* doc/install.texi: Document that the minimum MPFR version is
	3.1.0.

gcc/fortran/ChangeLog:

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

	PR fortran/91828
	* simplify.c (gfc_simplify_fraction): Remove fallback path for
	MPFR < 3.1.0.

From-SVN: r278058
parent 5fcb3f62
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.
2019-10-21 Jason Merrill <jason@redhat.com> 2019-10-21 Jason Merrill <jason@redhat.com>
* .gitattributes: Also check ChangeLog whitespace. * .gitattributes: Also check ChangeLog whitespace.
......
...@@ -5755,7 +5755,7 @@ int ...@@ -5755,7 +5755,7 @@ int
main () main ()
{ {
#if MPFR_VERSION < MPFR_VERSION_NUM(2,4,0) #if MPFR_VERSION < MPFR_VERSION_NUM(3,1,0)
choke me choke me
#endif #endif
...@@ -5772,7 +5772,7 @@ int ...@@ -5772,7 +5772,7 @@ int
main () main ()
{ {
#if MPFR_VERSION < MPFR_VERSION_NUM(2,4,2) #if MPFR_VERSION < MPFR_VERSION_NUM(3,1,6)
choke me choke me
#endif #endif
...@@ -5898,7 +5898,7 @@ rm -f core conftest.err conftest.$ac_objext \ ...@@ -5898,7 +5898,7 @@ rm -f core conftest.err conftest.$ac_objext \
# The library versions listed in the error message below should match # The library versions listed in the error message below should match
# the HARD-minimums enforced above. # the HARD-minimums enforced above.
if test x$have_gmp != xyes; then if test x$have_gmp != xyes; then
as_fn_error $? "Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+. as_fn_error $? "Building GCC requires GMP 4.2+, MPFR 3.1.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries can be found at their locations. Source code for these libraries can be found at
their respective hosting sites as well as at their respective hosting sites as well as at
......
...@@ -1601,12 +1601,12 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then ...@@ -1601,12 +1601,12 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then
AC_MSG_CHECKING([for the correct version of mpfr.h]) AC_MSG_CHECKING([for the correct version of mpfr.h])
AC_TRY_COMPILE([#include <gmp.h> AC_TRY_COMPILE([#include <gmp.h>
#include <mpfr.h>],[ #include <mpfr.h>],[
#if MPFR_VERSION < MPFR_VERSION_NUM(2,4,0) #if MPFR_VERSION < MPFR_VERSION_NUM(3,1,0)
choke me choke me
#endif #endif
], [AC_TRY_COMPILE([#include <gmp.h> ], [AC_TRY_COMPILE([#include <gmp.h>
#include <mpfr.h>],[ #include <mpfr.h>],[
#if MPFR_VERSION < MPFR_VERSION_NUM(2,4,2) #if MPFR_VERSION < MPFR_VERSION_NUM(3,1,6)
choke me choke me
#endif #endif
], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])], ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
...@@ -1661,7 +1661,7 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then ...@@ -1661,7 +1661,7 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then
# The library versions listed in the error message below should match # The library versions listed in the error message below should match
# the HARD-minimums enforced above. # the HARD-minimums enforced above.
if test x$have_gmp != xyes; then if test x$have_gmp != xyes; then
AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+. AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 3.1.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries can be found at their locations. Source code for these libraries can be found at
their respective hosting sites as well as at their respective hosting sites as well as at
......
2019-11-11 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/91828
* doc/install.texi: Document that the minimum MPFR version is
3.1.0.
2019-11-11 Claudiu Zissulescu <claziss@gmail.com> 2019-11-11 Claudiu Zissulescu <claziss@gmail.com>
* config/arc/arc.md (movsi_ne): Reorder instruction variants and * config/arc/arc.md (movsi_ne): Reorder instruction variants and
...@@ -384,7 +384,7 @@ and @option{--with-gmp-include}. ...@@ -384,7 +384,7 @@ and @option{--with-gmp-include}.
The in-tree build is only supported with the GMP version that The in-tree build is only supported with the GMP version that
download_prerequisites installs. download_prerequisites installs.
@item MPFR Library version 2.4.2 (or later) @item MPFR Library version 3.1.0 (or later)
Necessary to build GCC@. It can be downloaded from Necessary to build GCC@. It can be downloaded from
@uref{https://www.mpfr.org}. If an MPFR source distribution is found @uref{https://www.mpfr.org}. If an MPFR source distribution is found
......
2019-11-11 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/91828
* simplify.c (gfc_simplify_fraction): Remove fallback path for
MPFR < 3.1.0.
2019-11-11 Tobias Burnus <tobias@codesourcery.com> 2019-11-11 Tobias Burnus <tobias@codesourcery.com>
Kwok Cheung Yeung <kcy@codesourcery.com> Kwok Cheung Yeung <kcy@codesourcery.com>
......
...@@ -3076,12 +3076,7 @@ gfc_expr * ...@@ -3076,12 +3076,7 @@ gfc_expr *
gfc_simplify_fraction (gfc_expr *x) gfc_simplify_fraction (gfc_expr *x)
{ {
gfc_expr *result; gfc_expr *result;
#if MPFR_VERSION < MPFR_VERSION_NUM(3,1,0)
mpfr_t absv, exp, pow2;
#else
mpfr_exp_t e; mpfr_exp_t e;
#endif
if (x->expr_type != EXPR_CONSTANT) if (x->expr_type != EXPR_CONSTANT)
return NULL; return NULL;
...@@ -3095,41 +3090,9 @@ gfc_simplify_fraction (gfc_expr *x) ...@@ -3095,41 +3090,9 @@ gfc_simplify_fraction (gfc_expr *x)
return result; return result;
} }
#if MPFR_VERSION < MPFR_VERSION_NUM(3,1,0)
/* MPFR versions before 3.1.0 do not include mpfr_frexp.
TODO: remove the kludge when MPFR 3.1.0 or newer will be required */
if (mpfr_sgn (x->value.real) == 0)
{
mpfr_set (result->value.real, x->value.real, GFC_RND_MODE);
return result;
}
gfc_set_model_kind (x->ts.kind);
mpfr_init (exp);
mpfr_init (absv);
mpfr_init (pow2);
mpfr_abs (absv, x->value.real, GFC_RND_MODE);
mpfr_log2 (exp, absv, GFC_RND_MODE);
mpfr_trunc (exp, exp);
mpfr_add_ui (exp, exp, 1, GFC_RND_MODE);
mpfr_ui_pow (pow2, 2, exp, GFC_RND_MODE);
mpfr_div (result->value.real, x->value.real, pow2, GFC_RND_MODE);
mpfr_clears (exp, absv, pow2, NULL);
#else
/* mpfr_frexp() correctly handles zeros and NaNs. */ /* mpfr_frexp() correctly handles zeros and NaNs. */
mpfr_frexp (&e, result->value.real, x->value.real, GFC_RND_MODE); mpfr_frexp (&e, result->value.real, x->value.real, GFC_RND_MODE);
#endif
return range_check (result, "FRACTION"); return range_check (result, "FRACTION");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment