On 19.03.2016 21:29, Marc Glisse wrote: > On Tue, 5 Jan 2016, Richard Biener wrote: >> On January 5, 2016 2:20:42 PM GMT+01:00, Bernd Edlinger >> <bernd.edlin...@hotmail.de> wrote: >>> On 05.01.2016 13:58, Bernd Schmidt wrote: >>>> On 01/05/2016 09:44 AM, Bernd Edlinger wrote: >>>>> Using asm code is generally not desirable for in-tree mpfr builds. >>>> >>>> Why not? >>> >>> for the same reason why we disable the asm code for in-tree gmp. >>> If we think mpfr is fine to use assembler, why don't we let gmp use the >>> assember code too? >> >> IIRC the logic at some point at least used host CPU detection to >> select asm. > > Note that GMP only does host CPU detection if you let it (config.guess). > As soon as you pass an explicit --host= option to configure (easy for > gcc), that mechanism is disabled (at least that's what I think happens). > >>>>> So I looked for a way to disable the asm code, and found it can be >>>>> done, but differently than for in-tree gmp. See the attached patch. > > As noted in PR 67728, it seems that gcc's intrusive way of overriding > CFLAGS also breaks GMP itself, not just MPFR, by hiding the macro NO_ASM > that GMP tries to define through its own CFLAGS. So maybe Bernd's patch > should be duplicated to also apply to GMP? >
I agree, the question is only when. Passing -DNO_ASM in AM_CFLAGS would just define NO_ASM twice for GMP-4.3.2 which would not make any problems and fix the mis-compilation of GMP-6.1.0. That might be possible in stage4 if you like. OTOH there are more things that indicate problems with gmp-4.3.2 and should be changed, maybe in gcc-7. See PR 69881 where gmp header files define __need_size_t and include <cstddef> which caused undefined behavior with c++14. So I think we should update gmp, mpfr and mpc in gcc-7. Once we do that we can of course also replace the host=none with --disable-assembly flag, which would of course break the gmp-4.3.2 in-tree configuration because that was not yet invented. Bernd.