diff mbox

[RFC] Update gmp/mpfr/mpc minimum versions

Message ID HE1PR07MB15805C6A09E3DAC3380023BEE4640@HE1PR07MB1580.eurprd07.prod.outlook.com
State New
Headers show

Commit Message

Bernd Edlinger April 27, 2016, 3:30 p.m. UTC
On 26.04.2016 22:14, Joseph Myers wrote:
> On Tue, 26 Apr 2016, Bernd Edlinger wrote:
>
>> Hi,
>>
>> as we all know, it's high time now to adjust the minimum supported
>> gmp/mpfr/mpc versions for gcc-7.
>
> I think updating the minimum versions (when using previously built
> libraries, not in-tree) is only appropriate when it allows some cleanup in
> GCC, such as removing conditionals on whether a more recently added
> function is available, adding functionality that depends on a newer
> interface, or using newer interfaces instead of older ones that are now
> deprecated.
>
> For example, you could justify a move to requiring MPFR 3.0.0 or later
> with cleanups to use MPFR_RND* instead of the older GMP_RND*, and
> similarly mpfr_rnd_t instead of the older mp_rnd_t and likewise mpfr_exp_t
> and mpfr_prec_t in fortran/.  You could justify a move to requiring MPC
> 1.0.0 (or 1.0.2) by optimizing clog10 using mpc_log10.  I don't know what
> if any newer GMP interfaces would be beneficial in GCC.  And as always in
> such cases, it's a good idea to look at e.g. how widespread the newer
> versions are in GNU/Linux distributions, which indicates how many people
> might be affected by an increase in the version requirement.
>

Yes I see.

I would justify it this way: gmp-6.0.0 is the first version that does
not invoke undefined behavior in gmp.h, once we update to gmp-6.0.0
we could emit at least a warning in cstddef for this invalid code.

Once we have gmp-6.0.0, the earliest mpfr version that compiles at all
is mpfr-3.1.1 and the earliest mpc version that compiles at all is
mpc-0.9.  This would be the supported installed versions.

In-tree gmp-6.0.0 does _not_ work for ARM.  But gmp-6.1.0 does (with a
little quirk).  All supported mpfr and mpc versions are working in-tree
too, even for the ARM target.

When we have at least mpfr-3.1.1, it is straight forward to remove the
pre-3.1.0 compatibility code from gcc/fortran/simplify.c for instance.

So I would propose this updated patch for gcc-7.


Thanks
Bernd.
2016-04-26  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* configure.ac (mpfr): Remove pre-3.1.0 mpfr compatibility code.
	Adjust check to new minimum gmp, mpfr and mpc versions.
	* configure: Regenerated.
	* Makefile.def (gmp): Explicitly disable assembler.
	(mpfr): Adjust lib_path.
	(mpc): Likewise.
	* Makefile.in: Regenerated.

gcc/
2016-04-26  Bernd Edlinger  <bernd.edlinger@hotmail.de>

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

gcc/fortran/
2016-04-26  Bernd Edlinger  <bernd.edlinger@hotmail.de>

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

contrib/
2016-04-26  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* download_prerequisites: Adjust gmp/mpfr/mpc versions.

Comments

Rainer Orth April 27, 2016, 3:37 p.m. UTC | #1
Bernd Edlinger <bernd.edlinger@hotmail.de> writes:

> On 26.04.2016 22:14, Joseph Myers wrote:
>> On Tue, 26 Apr 2016, Bernd Edlinger wrote:
>>
>>> Hi,
>>>
>>> as we all know, it's high time now to adjust the minimum supported
>>> gmp/mpfr/mpc versions for gcc-7.
>>
>> I think updating the minimum versions (when using previously built
>> libraries, not in-tree) is only appropriate when it allows some cleanup in
>> GCC, such as removing conditionals on whether a more recently added
>> function is available, adding functionality that depends on a newer
>> interface, or using newer interfaces instead of older ones that are now
>> deprecated.
>>
>> For example, you could justify a move to requiring MPFR 3.0.0 or later
>> with cleanups to use MPFR_RND* instead of the older GMP_RND*, and
>> similarly mpfr_rnd_t instead of the older mp_rnd_t and likewise mpfr_exp_t
>> and mpfr_prec_t in fortran/.  You could justify a move to requiring MPC
>> 1.0.0 (or 1.0.2) by optimizing clog10 using mpc_log10.  I don't know what
>> if any newer GMP interfaces would be beneficial in GCC.  And as always in
>> such cases, it's a good idea to look at e.g. how widespread the newer
>> versions are in GNU/Linux distributions, which indicates how many people
>> might be affected by an increase in the version requirement.
>>
>
> Yes I see.
>
> I would justify it this way: gmp-6.0.0 is the first version that does
> not invoke undefined behavior in gmp.h, once we update to gmp-6.0.0
> we could emit at least a warning in cstddef for this invalid code.
>
> Once we have gmp-6.0.0, the earliest mpfr version that compiles at all
> is mpfr-3.1.1 and the earliest mpc version that compiles at all is
> mpc-0.9.  This would be the supported installed versions.
>
> In-tree gmp-6.0.0 does _not_ work for ARM.  But gmp-6.1.0 does (with a
> little quirk).  All supported mpfr and mpc versions are working in-tree
> too, even for the ARM target.
>
> When we have at least mpfr-3.1.1, it is straight forward to remove the
> pre-3.1.0 compatibility code from gcc/fortran/simplify.c for instance.
>
> So I would propose this updated patch for gcc-7.

would this version combo (gmp 6.0.0, mpfr 3.1.1, mpc 0.9) also work on
the active release branches (gcc-5 and gcc-6, gcc-4.9 is on it's way
out)?  Having to install two different sets of the libraries for trunk
and branch work would be extremely tedious.

	Rainer
Bernd Edlinger April 27, 2016, 3:47 p.m. UTC | #2
Am 27.04.2016 um 17:37 schrieb Rainer Orth:
> Bernd Edlinger <bernd.edlinger@hotmail.de> writes:
>
>> On 26.04.2016 22:14, Joseph Myers wrote:
>>> On Tue, 26 Apr 2016, Bernd Edlinger wrote:
>>>
>>>> Hi,
>>>>
>>>> as we all know, it's high time now to adjust the minimum supported
>>>> gmp/mpfr/mpc versions for gcc-7.
>>>
>>> I think updating the minimum versions (when using previously built
>>> libraries, not in-tree) is only appropriate when it allows some cleanup in
>>> GCC, such as removing conditionals on whether a more recently added
>>> function is available, adding functionality that depends on a newer
>>> interface, or using newer interfaces instead of older ones that are now
>>> deprecated.
>>>
>>> For example, you could justify a move to requiring MPFR 3.0.0 or later
>>> with cleanups to use MPFR_RND* instead of the older GMP_RND*, and
>>> similarly mpfr_rnd_t instead of the older mp_rnd_t and likewise mpfr_exp_t
>>> and mpfr_prec_t in fortran/.  You could justify a move to requiring MPC
>>> 1.0.0 (or 1.0.2) by optimizing clog10 using mpc_log10.  I don't know what
>>> if any newer GMP interfaces would be beneficial in GCC.  And as always in
>>> such cases, it's a good idea to look at e.g. how widespread the newer
>>> versions are in GNU/Linux distributions, which indicates how many people
>>> might be affected by an increase in the version requirement.
>>>
>>
>> Yes I see.
>>
>> I would justify it this way: gmp-6.0.0 is the first version that does
>> not invoke undefined behavior in gmp.h, once we update to gmp-6.0.0
>> we could emit at least a warning in cstddef for this invalid code.
>>
>> Once we have gmp-6.0.0, the earliest mpfr version that compiles at all
>> is mpfr-3.1.1 and the earliest mpc version that compiles at all is
>> mpc-0.9.  This would be the supported installed versions.
>>
>> In-tree gmp-6.0.0 does _not_ work for ARM.  But gmp-6.1.0 does (with a
>> little quirk).  All supported mpfr and mpc versions are working in-tree
>> too, even for the ARM target.
>>
>> When we have at least mpfr-3.1.1, it is straight forward to remove the
>> pre-3.1.0 compatibility code from gcc/fortran/simplify.c for instance.
>>
>> So I would propose this updated patch for gcc-7.
>
> would this version combo (gmp 6.0.0, mpfr 3.1.1, mpc 0.9) also work on
> the active release branches (gcc-5 and gcc-6, gcc-4.9 is on it's way
> out)?  Having to install two different sets of the libraries for trunk
> and branch work would be extremely tedious.
>
> 	Rainer
>

Yes, when they are pre-installed there should be no problem.
Also newer versions than these seem to work.

In-tree only the versions that download_prerequisite picks are
tested and guaranteed to work.
Richard Biener April 28, 2016, 7:09 a.m. UTC | #3
On Wed, 27 Apr 2016, Bernd Edlinger wrote:

> On 26.04.2016 22:14, Joseph Myers wrote:
> > On Tue, 26 Apr 2016, Bernd Edlinger wrote:
> >
> >> Hi,
> >>
> >> as we all know, it's high time now to adjust the minimum supported
> >> gmp/mpfr/mpc versions for gcc-7.
> >
> > I think updating the minimum versions (when using previously built
> > libraries, not in-tree) is only appropriate when it allows some cleanup in
> > GCC, such as removing conditionals on whether a more recently added
> > function is available, adding functionality that depends on a newer
> > interface, or using newer interfaces instead of older ones that are now
> > deprecated.
> >
> > For example, you could justify a move to requiring MPFR 3.0.0 or later
> > with cleanups to use MPFR_RND* instead of the older GMP_RND*, and
> > similarly mpfr_rnd_t instead of the older mp_rnd_t and likewise mpfr_exp_t
> > and mpfr_prec_t in fortran/.  You could justify a move to requiring MPC
> > 1.0.0 (or 1.0.2) by optimizing clog10 using mpc_log10.  I don't know what
> > if any newer GMP interfaces would be beneficial in GCC.  And as always in
> > such cases, it's a good idea to look at e.g. how widespread the newer
> > versions are in GNU/Linux distributions, which indicates how many people
> > might be affected by an increase in the version requirement.
> >
> 
> Yes I see.
> 
> I would justify it this way: gmp-6.0.0 is the first version that does
> not invoke undefined behavior in gmp.h, once we update to gmp-6.0.0
> we could emit at least a warning in cstddef for this invalid code.
> 
> Once we have gmp-6.0.0, the earliest mpfr version that compiles at all
> is mpfr-3.1.1 and the earliest mpc version that compiles at all is
> mpc-0.9.  This would be the supported installed versions.
> 
> In-tree gmp-6.0.0 does _not_ work for ARM.  But gmp-6.1.0 does (with a
> little quirk).  All supported mpfr and mpc versions are working in-tree
> too, even for the ARM target.
> 
> When we have at least mpfr-3.1.1, it is straight forward to remove the
> pre-3.1.0 compatibility code from gcc/fortran/simplify.c for instance.
> 
> So I would propose this updated patch for gcc-7.

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.

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.

Thanks,
Richard.
Richard Biener April 28, 2016, 12:35 p.m. UTC | #4
On Thu, 28 Apr 2016, Bernd Edlinger wrote:

> Hi,
> 
> here is the first part of the patch that addresses only the in-tree
> builds.  I tried different combinations of the documented supported
> in-tree versions, and all combinations seem to work.
> Then I changed the download_prerequisites batch to pick each pre-
> requisite's minimum version (that part is not tested, because I have
> no way to update the gcc.gnu.org ftp server).
> 
> Various boot-straps for x86_64-linux-gnu and armv7-linux-gnueabihf
> were successful.
> 
> Is it OK for trunk?

Please do not document that in-tree versions greater than XXX are
supported, instead just point at download_prerequesites.

Why do you not update to latest mpc (there is 1.0.3) and mpfr but leave 
bugfixes for mpfr on the plate (there is 3.1.4).

Does it make sense to wait for a new GMP release that allows to get
rid of -DNO_ASM?

I will upload mpfr 3.1.4 and mpc 1.0.3.

Thanks,
Richard.

> Thanks
> Bernd.
>
Rainer Orth April 29, 2016, 8:53 a.m. UTC | #5
Hi Bernd,

>> would this version combo (gmp 6.0.0, mpfr 3.1.1, mpc 0.9) also work on
>> the active release branches (gcc-5 and gcc-6, gcc-4.9 is on it's way
>> out)?  Having to install two different sets of the libraries for trunk
>> and branch work would be extremely tedious.
>>
>> 	Rainer
>>
>
> Yes, when they are pre-installed there should be no problem.
> Also newer versions than these seem to work.
>
> In-tree only the versions that download_prerequisite picks are
> tested and guaranteed to work.

fine with me: I never cared about (or even got the point of) in-tree
builds of this stuff.

	Rainer
Martin Sebor Sept. 22, 2016, 5:26 p.m. UTC | #6
On 04/27/2016 09:47 AM, Bernd Edlinger wrote:
>
>
> Am 27.04.2016 um 17:37 schrieb Rainer Orth:
>> Bernd Edlinger <bernd.edlinger@hotmail.de> writes:
>>
>>> On 26.04.2016 22:14, Joseph Myers wrote:
>>>> On Tue, 26 Apr 2016, Bernd Edlinger wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> as we all know, it's high time now to adjust the minimum supported
>>>>> gmp/mpfr/mpc versions for gcc-7.
>>>>
>>>> I think updating the minimum versions (when using previously built
>>>> libraries, not in-tree) is only appropriate when it allows some cleanup in
>>>> GCC, such as removing conditionals on whether a more recently added
>>>> function is available, adding functionality that depends on a newer
>>>> interface, or using newer interfaces instead of older ones that are now
>>>> deprecated.
>>>>
>>>> For example, you could justify a move to requiring MPFR 3.0.0 or later
>>>> with cleanups to use MPFR_RND* instead of the older GMP_RND*, and
>>>> similarly mpfr_rnd_t instead of the older mp_rnd_t and likewise mpfr_exp_t
>>>> and mpfr_prec_t in fortran/.  You could justify a move to requiring MPC
>>>> 1.0.0 (or 1.0.2) by optimizing clog10 using mpc_log10.  I don't know what
>>>> if any newer GMP interfaces would be beneficial in GCC.  And as always in
>>>> such cases, it's a good idea to look at e.g. how widespread the newer
>>>> versions are in GNU/Linux distributions, which indicates how many people
>>>> might be affected by an increase in the version requirement.
>>>>
>>>
>>> Yes I see.
>>>
>>> I would justify it this way: gmp-6.0.0 is the first version that does
>>> not invoke undefined behavior in gmp.h, once we update to gmp-6.0.0
>>> we could emit at least a warning in cstddef for this invalid code.
>>>
>>> Once we have gmp-6.0.0, the earliest mpfr version that compiles at all
>>> is mpfr-3.1.1 and the earliest mpc version that compiles at all is
>>> mpc-0.9.  This would be the supported installed versions.
>>>
>>> In-tree gmp-6.0.0 does _not_ work for ARM.  But gmp-6.1.0 does (with a
>>> little quirk).  All supported mpfr and mpc versions are working in-tree
>>> too, even for the ARM target.
>>>
>>> When we have at least mpfr-3.1.1, it is straight forward to remove the
>>> pre-3.1.0 compatibility code from gcc/fortran/simplify.c for instance.
>>>
>>> So I would propose this updated patch for gcc-7.
>>
>> would this version combo (gmp 6.0.0, mpfr 3.1.1, mpc 0.9) also work on
>> the active release branches (gcc-5 and gcc-6, gcc-4.9 is on it's way
>> out)?  Having to install two different sets of the libraries for trunk
>> and branch work would be extremely tedious.
>>
>> 	Rainer
>>
>
> Yes, when they are pre-installed there should be no problem.
> Also newer versions than these seem to work.
>
> In-tree only the versions that download_prerequisite picks are
> tested and guaranteed to work.

I was made aware today that my recent patch for pr49905 broke
bootstrap with MPFR 2.4:

   https://gcc.gnu.org/ml/gcc-patches/2016-09/msg01507.html

In light of this risk and given that the recommended MPFR version
is still 2.4 I wonder if the download_prerequisites script shouldn't
instead download the minimum supported version.  That way those of
us working with MPFR but not intimately familiar with its version
specific details would have an easier way of avoiding such breakage.

Alternatively, perhaps the script could be extended to make it
possible to choose between the most recent and the recommended
versions of the prerequisites that GCC is intended to work with,
and people who make use of either in their code encouraged to
test with both.

Martin
Joseph Myers Sept. 22, 2016, 5:31 p.m. UTC | #7
On Thu, 22 Sep 2016, Martin Sebor wrote:

> In light of this risk and given that the recommended MPFR version
> is still 2.4 I wonder if the download_prerequisites script shouldn't
> instead download the minimum supported version.  That way those of

No, it should download the latest version known to work with the script 
and we should routinely review and update those versions (preferably they 
should be the latest releases of the libraries, subject to avoiding major 
updates while in bug-fixing mode).  We should not encourage use of ancient 
versions, although we should only update the minimum when there's actually 
a new feature we want to use (that feature may just be a convenience 
rather than something hard to avoid, if the minimum version with it is old 
enough).
Bernd Edlinger Sept. 22, 2016, 5:43 p.m. UTC | #8
On 09/22/16 19:26, Martin Sebor wrote:
> On 04/27/2016 09:47 AM, Bernd Edlinger wrote:
>>
>>
>> Yes, when they are pre-installed there should be no problem.
>> Also newer versions than these seem to work.
>>
>> In-tree only the versions that download_prerequisite picks are
>> tested and guaranteed to work.
>
> I was made aware today that my recent patch for pr49905 broke
> bootstrap with MPFR 2.4:
>
>    https://gcc.gnu.org/ml/gcc-patches/2016-09/msg01507.html
>
> In light of this risk and given that the recommended MPFR version
> is still 2.4 I wonder if the download_prerequisites script shouldn't
> instead download the minimum supported version.  That way those of
> us working with MPFR but not intimately familiar with its version
> specific details would have an easier way of avoiding such breakage.
>
> Alternatively, perhaps the script could be extended to make it
> possible to choose between the most recent and the recommended
> versions of the prerequisites that GCC is intended to work with,
> and people who make use of either in their code encouraged to
> test with both.
>
> Martin
>


There is no feasible way how to make all gmp/mpfr/mpc versions from
minimal to latest build for all targets and all possible
cross-configurations.

I hope that we do not "recommend" these versions.

They are only the minimum versions for pre-installed packages.



Bernd.
Joseph Myers Sept. 22, 2016, 6 p.m. UTC | #9
On Thu, 22 Sep 2016, Bernd Edlinger wrote:

> There is no feasible way how to make all gmp/mpfr/mpc versions from
> minimal to latest build for all targets and all possible
> cross-configurations.
> 
> I hope that we do not "recommend" these versions.
> 
> They are only the minimum versions for pre-installed packages.

And personally I think it would by now be reasonable to require MPFR 3.0 
or 3.1 as a minimum version should someone wish to make the various 
cleanups mentioned in the April discussion, so avoiding claiming to 
support configurations few developers will be testing.  (MPFR 3.1 came out 
nearly five years ago - 3 Oct 2011.)
Richard Biener Sept. 22, 2016, 6:05 p.m. UTC | #10
On September 22, 2016 8:00:40 PM GMT+02:00, Joseph Myers <joseph@codesourcery.com> wrote:
>On Thu, 22 Sep 2016, Bernd Edlinger wrote:
>
>> There is no feasible way how to make all gmp/mpfr/mpc versions from
>> minimal to latest build for all targets and all possible
>> cross-configurations.
>> 
>> I hope that we do not "recommend" these versions.
>> 
>> They are only the minimum versions for pre-installed packages.
>
>And personally I think it would by now be reasonable to require MPFR
>3.0 
>or 3.1 as a minimum version should someone wish to make the various 
>cleanups mentioned in the April discussion, so avoiding claiming to 
>support configurations few developers will be testing.  (MPFR 3.1 came
>out 
>nearly five years ago - 3 Oct 2011.)

Hmpf, it will be a hassle to update all our auto-testers again...  So, yes, we are 'testing' with those versions.

Richard.
Bernd Edlinger Sept. 22, 2016, 6:10 p.m. UTC | #11
On 09/22/16 20:00, Joseph Myers wrote:
> On Thu, 22 Sep 2016, Bernd Edlinger wrote:
>
>> There is no feasible way how to make all gmp/mpfr/mpc versions from
>> minimal to latest build for all targets and all possible
>> cross-configurations.
>>
>> I hope that we do not "recommend" these versions.
>>
>> They are only the minimum versions for pre-installed packages.
>
> And personally I think it would by now be reasonable to require MPFR 3.0
> or 3.1 as a minimum version should someone wish to make the various
> cleanups mentioned in the April discussion, so avoiding claiming to
> support configurations few developers will be testing.  (MPFR 3.1 came out
> nearly five years ago - 3 Oct 2011.)
>

Yes, and we have workarounds for more than just convenience features
that are missing in MPFR 2.4.

I proposed to remove them in April but Richard was against it.


Bernd.
diff mbox

Patch

Index: Makefile.def
===================================================================
--- Makefile.def	(Revision 235487)
+++ Makefile.def	(Arbeitskopie)
@@ -50,6 +50,7 @@  host_modules= { module= gcc; bootstrap=true;
 host_modules= { module= gmp; lib_path=.libs; bootstrap=true;
 		// Work around in-tree gmp configure bug with missing flex.
 		extra_configure_flags='--disable-shared LEX="touch lex.yy.c"';
+		extra_make_flags='AM_CFLAGS="-DNO_ASM"';
 		no_install= true;
 		// none-*-* disables asm optimizations, bootstrap-testing
 		// the compiler more thoroughly.
@@ -57,11 +58,11 @@  host_modules= { module= gmp; lib_path=.libs; boots
 		// gmp's configure will complain if given anything
 		// different from host for target.
 	        target="none-${host_vendor}-${host_os}"; };
-host_modules= { module= mpfr; lib_path=.libs; bootstrap=true;
+host_modules= { module= mpfr; lib_path=src/.libs; bootstrap=true;
 		extra_configure_flags='--disable-shared @extra_mpfr_configure_flags@';
 		extra_make_flags='AM_CFLAGS="-DNO_ASM"';
 		no_install= true; };
-host_modules= { module= mpc; lib_path=.libs; bootstrap=true;
+host_modules= { module= mpc; lib_path=src/.libs; bootstrap=true;
 		extra_configure_flags='--disable-shared @extra_mpc_gmp_configure_flags@ @extra_mpc_mpfr_configure_flags@';
 		no_install= true; };
 host_modules= { module= isl; lib_path=.libs; bootstrap=true;
Index: Makefile.in
===================================================================
--- Makefile.in	(Revision 235487)
+++ Makefile.in	(Arbeitskopie)
@@ -639,12 +639,12 @@  HOST_LIB_PATH_gmp = \
 
 @if mpfr
 HOST_LIB_PATH_mpfr = \
-  $$r/$(HOST_SUBDIR)/mpfr/.libs:$$r/$(HOST_SUBDIR)/prev-mpfr/.libs:
+  $$r/$(HOST_SUBDIR)/mpfr/src/.libs:$$r/$(HOST_SUBDIR)/prev-mpfr/src/.libs:
 @endif mpfr
 
 @if mpc
 HOST_LIB_PATH_mpc = \
-  $$r/$(HOST_SUBDIR)/mpc/.libs:$$r/$(HOST_SUBDIR)/prev-mpc/.libs:
+  $$r/$(HOST_SUBDIR)/mpc/src/.libs:$$r/$(HOST_SUBDIR)/prev-mpc/src/.libs:
 @endif mpc
 
 @if isl
@@ -11300,7 +11300,7 @@  all-gmp: configure-gmp
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS)  \
 	(cd $(HOST_SUBDIR)/gmp && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(STAGE1_FLAGS_TO_PASS)  \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(STAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" \
 		$(TARGET-gmp))
 @endif gmp
 
@@ -11329,7 +11329,7 @@  all-stage1-gmp: configure-stage1-gmp
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
 		$(EXTRA_HOST_FLAGS)  \
-		$(STAGE1_FLAGS_TO_PASS)  \
+		$(STAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" \
 		TFLAGS="$(STAGE1_TFLAGS)" \
 		$(TARGET-stage1-gmp)
 
@@ -11344,7 +11344,7 @@  clean-stage1-gmp:
 	fi; \
 	cd $(HOST_SUBDIR)/gmp && \
 	$(MAKE) $(EXTRA_HOST_FLAGS)  \
-	$(STAGE1_FLAGS_TO_PASS)  clean
+	$(STAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" clean
 @endif gmp-bootstrap
 
 
@@ -11371,7 +11371,7 @@  all-stage2-gmp: configure-stage2-gmp
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" \
 		TFLAGS="$(STAGE2_TFLAGS)" \
 		$(TARGET-stage2-gmp)
 
@@ -11385,7 +11385,7 @@  clean-stage2-gmp:
 	  $(MAKE) stage2-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gmp && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" clean
 @endif gmp-bootstrap
 
 
@@ -11412,7 +11412,7 @@  all-stage3-gmp: configure-stage3-gmp
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" \
 		TFLAGS="$(STAGE3_TFLAGS)" \
 		$(TARGET-stage3-gmp)
 
@@ -11426,7 +11426,7 @@  clean-stage3-gmp:
 	  $(MAKE) stage3-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gmp && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" clean
 @endif gmp-bootstrap
 
 
@@ -11453,7 +11453,7 @@  all-stage4-gmp: configure-stage4-gmp
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" \
 		TFLAGS="$(STAGE4_TFLAGS)" \
 		$(TARGET-stage4-gmp)
 
@@ -11467,7 +11467,7 @@  clean-stage4-gmp:
 	  $(MAKE) stage4-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gmp && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" clean
 @endif gmp-bootstrap
 
 
@@ -11494,7 +11494,7 @@  all-stageprofile-gmp: configure-stageprofile-gmp
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" \
 		TFLAGS="$(STAGEprofile_TFLAGS)" \
 		$(TARGET-stageprofile-gmp)
 
@@ -11508,7 +11508,7 @@  clean-stageprofile-gmp:
 	  $(MAKE) stageprofile-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gmp && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" clean
 @endif gmp-bootstrap
 
 
@@ -11535,7 +11535,7 @@  all-stagefeedback-gmp: configure-stagefeedback-gmp
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" \
 		TFLAGS="$(STAGEfeedback_TFLAGS)" \
 		$(TARGET-stagefeedback-gmp)
 
@@ -11549,7 +11549,7 @@  clean-stagefeedback-gmp:
 	  $(MAKE) stagefeedback-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gmp && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" clean
 @endif gmp-bootstrap
 
 
@@ -11567,7 +11567,7 @@  check-gmp:
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) $(EXTRA_HOST_EXPORTS) \
 	(cd $(HOST_SUBDIR)/gmp && \
-	  $(MAKE) $(FLAGS_TO_PASS)  $(EXTRA_BOOTSTRAP_FLAGS) check)
+	  $(MAKE) $(FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" $(EXTRA_BOOTSTRAP_FLAGS) check)
 
 @endif gmp
 
@@ -11602,7 +11602,7 @@  info-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing info in gmp"; \
@@ -11627,7 +11627,7 @@  dvi-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing dvi in gmp"; \
@@ -11652,7 +11652,7 @@  pdf-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing pdf in gmp"; \
@@ -11677,7 +11677,7 @@  html-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing html in gmp"; \
@@ -11702,7 +11702,7 @@  TAGS-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing TAGS in gmp"; \
@@ -11728,7 +11728,7 @@  install-info-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing install-info in gmp"; \
@@ -11754,7 +11754,7 @@  install-pdf-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing install-pdf in gmp"; \
@@ -11780,7 +11780,7 @@  install-html-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing install-html in gmp"; \
@@ -11805,7 +11805,7 @@  installcheck-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing installcheck in gmp"; \
@@ -11829,7 +11829,7 @@  mostlyclean-gmp:
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing mostlyclean in gmp"; \
@@ -11853,7 +11853,7 @@  clean-gmp:
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing clean in gmp"; \
@@ -11877,7 +11877,7 @@  distclean-gmp:
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing distclean in gmp"; \
@@ -11901,7 +11901,7 @@  maintainer-clean-gmp:
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing maintainer-clean in gmp"; \
Index: configure
===================================================================
--- configure	(Revision 235487)
+++ configure	(Arbeitskopie)
@@ -5570,16 +5570,9 @@  if test "x$with_mpfr_lib" != x; then
   gmplibs="-L$with_mpfr_lib $gmplibs"
 fi
 if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
-  # MPFR v3.1.0 moved the sources into a src sub-directory.
-  if test -d ${srcdir}/mpfr/src; then
-    gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir $gmplibs"
-    gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src '"$gmpinc"
-    extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr/src --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir"
-  else
-    gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir $gmplibs"
-    gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc"
-    extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir"
-  fi
+  gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir $gmplibs"
+  gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src '"$gmpinc"
+  extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr/src --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir"
   # Do not test the mpfr version.  Assume that it is sufficient, since
   # it is in the source tree, and the library has not been built yet
   # but it would be included on the link line in the version check below
@@ -5649,24 +5642,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 ()
@@ -5674,7 +5649,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
 
@@ -5686,11 +5661,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
@@ -5709,7 +5679,7 @@  int
 main ()
 {
 
-    #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,0)
+    #if MPFR_VERSION < MPFR_VERSION_NUM(3,1,1)
     choke me
     #endif
 
@@ -5718,31 +5688,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
@@ -5761,7 +5709,7 @@  int
 main ()
 {
 
-    #if MPC_VERSION < MPC_VERSION_NUM(0,8,0)
+    #if MPC_VERSION < MPC_VERSION_NUM(0,9,0)
     choke me
     #endif
 
@@ -5770,30 +5718,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 235487)
+++ configure.ac	(Arbeitskopie)
@@ -1550,16 +1550,9 @@  if test "x$with_mpfr_lib" != x; then
   gmplibs="-L$with_mpfr_lib $gmplibs"
 fi
 if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
-  # MPFR v3.1.0 moved the sources into a src sub-directory.
-  if test -d ${srcdir}/mpfr/src; then
-    gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir $gmplibs"
-    gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src '"$gmpinc"
-    extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr/src --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir"
-  else
-    gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir $gmplibs"
-    gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc"
-    extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir"
-  fi
+  gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir $gmplibs"
+  gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src '"$gmpinc"
+  extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr/src --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir"
   # Do not test the mpfr version.  Assume that it is sufficient, since
   # it is in the source tree, and the library has not been built yet
   # but it would be included on the link line in the version check below
@@ -1615,20 +1608,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
@@ -1636,16 +1623,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.
@@ -1653,15 +1635,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: contrib/download_prerequisites
===================================================================
--- contrib/download_prerequisites	(Revision 235487)
+++ contrib/download_prerequisites	(Arbeitskopie)
@@ -30,9 +30,9 @@  if [ ! -e gcc/BASE-VER ] ; then
 fi
 
 # Necessary to build GCC.
-MPFR=mpfr-2.4.2
-GMP=gmp-4.3.2
-MPC=mpc-0.8.1
+MPFR=mpfr-3.1.1
+GMP=gmp-6.1.0
+MPC=mpc-0.9
 
 wget ftp://gcc.gnu.org/pub/gcc/infrastructure/$MPFR.tar.bz2 || exit 1
 tar xjf $MPFR.tar.bz2 || exit 1
Index: gcc/doc/install.texi
===================================================================
--- gcc/doc/install.texi	(Revision 235487)
+++ gcc/doc/install.texi	(Arbeitskopie)
@@ -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
@@ -362,8 +362,9 @@  together with GCC.  Alternatively, if GMP is alrea
 is not in your library search path, you will have to configure with the
 @option{--with-gmp} configure option.  See also @option{--with-gmp-lib}
 and @option{--with-gmp-include}.
+The in-tree build is only supported with GMP version 6.1.0 (or later).
 
-@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
@@ -373,7 +374,7 @@  but it is not in your default library search path,
 @option{--with-mpfr} configure option should be used.  See also
 @option{--with-mpfr-lib} and @option{--with-mpfr-include}.
 
-@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 235487)
+++ gcc/fortran/simplify.c	(Arbeitskopie)
@@ -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");
 }