On 28.04.2016 09:09, Richard Biener wrote:
>
> As said elsewhere the main reason for all of this is to make the
> in-tree builds work better for newer archs that are not happy with
> the versions provided by download_prerequesites.  This should come
> with a documentation adjustment that the only tested in-tree
> versions are those downloaded by dowload_prerequesites.

That patch is installed now, and so far nothing bad has happened.

> Please address updating the minimum supported _installed_ version
> separately (in fact I do maintain a patch to disable stuff to be
> able to go back to even older mpfr versions ... :/).
>
> SLES 11 ships with mpfr 2.3.2, mpc 0.8 and gmp 4.2.3 while SLES 12
> and openSUSE Leap have gmp 5.1.3, mpfr 3.1.2 and mpc 1.0.2.

Of course updating to a more recent gmp version is not the most
important thing in the world, and I am not trying to make gcc emit
an error when compiling gmp 5.1.3, but I think emitting a warning
for this code would be fair.

So here is the next step.

This patch raises the installed gmp version to 6.0.0 or higher,
the installed mpfr version to 3.1.1 or higher and the
installed mpc version to 0.9 or higher.  So Jakub's currently
installed versions will be fine, even a bit older versions
will work, but unfortunately gmp 5.1.3 will not work.

I also attached a sketch of what I'd like to propose on the
libstdc++ list, once we can rely on the gmp.h not to trigger
these new warnings in cstddef.  With the gmp 5.1.3 or earlier
one of this warnings made the boot-strap fail in stage2.

Boot-strapped and reg-tested on x86_64-linux-gnu.
Is it OK for trunk?


Thanks
Bernd.
2016-05-03  Bernd Edlinger  <bernd.edlin...@hotmail.de>

        * configure.ac (mpfr): Adjust check to new minimum gmp, mpfr and mpc
        versions.
        * configure: Regenerated.

gcc/
2016-05-03  Bernd Edlinger  <bernd.edlin...@hotmail.de>

        * doc/install.texi: Adjust gmp/mpfr/mpc minimum versions.

gcc/fortran/
2016-05-03  Bernd Edlinger  <bernd.edlin...@hotmail.de>

        * simplify.c (gfc_simplify_fraction): Remove pre-3.1.0 mpfr
        compatibility code.

Index: configure
===================================================================
--- configure	(revision 235816)
+++ configure	(working copy)
@@ -5640,24 +5640,6 @@ $as_echo_n "checking for the correct version of gm
 
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include "gmp.h"
-int
-main ()
-{
-
-  #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
-  #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
-  #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,2,3)
-  choke me
-  #endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 #include <gmp.h>
 int
 main ()
@@ -5665,7 +5647,7 @@ main ()
 
   #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
   #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
-  #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,3,2)
+  #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(6,0,0)
   choke me
   #endif
 
@@ -5677,11 +5659,6 @@ if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy but acceptable" >&5
-$as_echo "buggy but acceptable" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }; have_gmp=no
 fi
@@ -5700,7 +5677,7 @@ int
 main ()
 {
 
-    #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,0)
+    #if MPFR_VERSION < MPFR_VERSION_NUM(3,1,1)
     choke me
     #endif
 
@@ -5709,31 +5686,9 @@ main ()
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <gmp.h>
-    #include <mpfr.h>
-int
-main ()
-{
-
-    #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,2)
-    choke me
-    #endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy but acceptable" >&5
-$as_echo "buggy but acceptable" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }; have_gmp=no
 fi
@@ -5752,7 +5707,7 @@ int
 main ()
 {
 
-    #if MPC_VERSION < MPC_VERSION_NUM(0,8,0)
+    #if MPC_VERSION < MPC_VERSION_NUM(0,9,0)
     choke me
     #endif
 
@@ -5761,30 +5716,9 @@ main ()
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <mpc.h>
-int
-main ()
-{
-
-    #if MPC_VERSION < MPC_VERSION_NUM(0,8,1)
-    choke me
-    #endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy but acceptable" >&5
-$as_echo "buggy but acceptable" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }; have_gmp=no
 fi
Index: configure.ac
===================================================================
--- configure.ac	(revision 235816)
+++ configure.ac	(working copy)
@@ -1606,20 +1606,14 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xn
   CFLAGS="$CFLAGS $gmpinc"
   # Check for the recommended and required versions of GMP.
   AC_MSG_CHECKING([for the correct version of gmp.h])
-  AC_TRY_COMPILE([#include "gmp.h"],[
+  AC_TRY_COMPILE([#include <gmp.h>],[
   #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
   #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
-  #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,2,3)
+  #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(6,0,0)
   choke me
   #endif
-  ], [AC_TRY_COMPILE([#include <gmp.h>],[
-  #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
-  #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
-  #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,3,2)
-  choke me
-  #endif
-  ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
-   [AC_MSG_RESULT([no]); have_gmp=no])
+  ], [AC_MSG_RESULT([yes])],
+     [AC_MSG_RESULT([no]); have_gmp=no])
 
   # If we have GMP, check the MPFR version.
   if test x"$have_gmp" = xyes; then
@@ -1627,16 +1621,11 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xn
     AC_MSG_CHECKING([for the correct version of mpfr.h])
     AC_TRY_COMPILE([#include <gmp.h>
     #include <mpfr.h>],[
-    #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,0)
+    #if MPFR_VERSION < MPFR_VERSION_NUM(3,1,1)
     choke me
     #endif
-    ], [AC_TRY_COMPILE([#include <gmp.h>
-    #include <mpfr.h>],[
-    #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,2)
-    choke me
-    #endif
-    ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
-     [AC_MSG_RESULT([no]); have_gmp=no])
+    ], [AC_MSG_RESULT([yes])],
+       [AC_MSG_RESULT([no]); have_gmp=no])
   fi
 
   # Check for the MPC header version.
@@ -1644,15 +1633,11 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xn
     # Check for the recommended and required versions of MPC.
     AC_MSG_CHECKING([for the correct version of mpc.h])
     AC_TRY_COMPILE([#include <mpc.h>],[
-    #if MPC_VERSION < MPC_VERSION_NUM(0,8,0)
+    #if MPC_VERSION < MPC_VERSION_NUM(0,9,0)
     choke me
     #endif
-    ], [AC_TRY_COMPILE([#include <mpc.h>],[
-    #if MPC_VERSION < MPC_VERSION_NUM(0,8,1)
-    choke me
-    #endif
-    ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
-     [AC_MSG_RESULT([no]); have_gmp=no])
+    ], [AC_MSG_RESULT([yes])],
+       [AC_MSG_RESULT([no]); have_gmp=no])
   fi
 
   # Now check the MPFR library.
Index: gcc/doc/install.texi
===================================================================
--- gcc/doc/install.texi	(revision 235816)
+++ gcc/doc/install.texi	(working copy)
@@ -354,7 +354,7 @@ support libraries then using those packages may be
 install the libraries.
 
 @table @asis
-@item GNU Multiple Precision Library (GMP) version 4.3.2 (or later)
+@item GNU Multiple Precision Library (GMP) version 6.0.0 (or later)
 
 Necessary to build GCC@.  If a GMP source distribution is found in a
 subdirectory of your GCC sources named @file{gmp}, it will be built
@@ -365,7 +365,7 @@ and @option{--with-gmp-include}.
 The in-tree build is only supported with the GMP version that
 download_prerequisites installs.
 
-@item MPFR Library version 2.4.2 (or later)
+@item MPFR Library version 3.1.1 (or later)
 
 Necessary to build GCC@.  It can be downloaded from
 @uref{http://www.mpfr.org/}.  If an MPFR source distribution is found
@@ -377,7 +377,7 @@ but it is not in your default library search path,
 The in-tree build is only supported with the MPFR version that
 download_prerequisites installs.
 
-@item MPC Library version 0.8.1 (or later)
+@item MPC Library version 0.9 (or later)
 
 Necessary to build GCC@.  It can be downloaded from
 @uref{http://www.multiprecision.org/}.  If an MPC source distribution
Index: gcc/fortran/simplify.c
===================================================================
--- gcc/fortran/simplify.c	(revision 235816)
+++ gcc/fortran/simplify.c	(working copy)
@@ -2455,12 +2455,7 @@ gfc_expr *
 gfc_simplify_fraction (gfc_expr *x)
 {
   gfc_expr *result;
-
-#if MPFR_VERSION < MPFR_VERSION_NUM(3,1,0)
-  mpfr_t absv, exp, pow2;
-#else
   mpfr_exp_t e;
-#endif
 
   if (x->expr_type != EXPR_CONSTANT)
     return NULL;
@@ -2474,41 +2469,9 @@ gfc_simplify_fraction (gfc_expr *x)
       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 (&e, result->value.real, x->value.real, GFC_RND_MODE);
 
-#endif
-
   return range_check (result, "FRACTION");
 }
 
Index: libstdc++-v3/include/c_global/cstdarg
===================================================================
--- libstdc++-v3/include/c_global/cstdarg	(revision 235816)
+++ libstdc++-v3/include/c_global/cstdarg	(working copy)
@@ -36,15 +36,18 @@
 // ISO C++ 14882: 20.4.6  C library
 //
 
+#ifndef _GLIBCXX_CSTDARG
+#define _GLIBCXX_CSTDARG 1
+
 #pragma GCC system_header
 
+#ifdef __need___va_list
+#warning __need___va_list should not be defined here
 #undef __need___va_list
+#endif
 #include <bits/c++config.h>
 #include <stdarg.h>
 
-#ifndef _GLIBCXX_CSTDARG
-#define _GLIBCXX_CSTDARG 1
-
 // Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
 #ifndef va_end
 #define va_end(ap) va_end (ap)
Index: libstdc++-v3/include/c_global/cstddef
===================================================================
--- libstdc++-v3/include/c_global/cstddef	(revision 235816)
+++ libstdc++-v3/include/c_global/cstddef	(working copy)
@@ -41,11 +41,26 @@
 
 #pragma GCC system_header
 
+#ifdef __need_wchar_t
+#warning __need_wchar_t should not be defined here
 #undef __need_wchar_t
+#endif
+#ifdef __need_ptrdiff_t
+#warning __need_ptrdiff_t should not be defined here
 #undef __need_ptrdiff_t
+#endif
+#ifdef __need_size_t
+#warning __need_size_t should not be defined here
 #undef __need_size_t
+#endif
+#ifdef __need_NULL
+#warning __need_NULL should not be defined here
 #undef __need_NULL
+#endif
+#ifdef __need_wint_t
+#warning __need_wint_t should not be defined here
 #undef __need_wint_t
+#endif
 #include <bits/c++config.h>
 #include <stddef.h>
 

Reply via email to