This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATHCH] Disable inline asm for in-tree mpfr (PR69134)
- From: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 20 Mar 2016 09:25:45 +0000
- Subject: Re: [PATHCH] Disable inline asm for in-tree mpfr (PR69134)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=hotmail.de;
- References: <HE1PR07MB0905C105ACF251FCE1780826E4F30 at HE1PR07MB0905 dot eurprd07 dot prod dot outlook dot com> <568BBDF7 dot 8040300 at redhat dot com> <HE1PR07MB090587484749F80CBD81F67CE4F30 at HE1PR07MB0905 dot eurprd07 dot prod dot outlook dot com> <9FFD837C-4FE2-405D-B1C6-94770F8BCA9C at suse dot de> <alpine dot DEB dot 2 dot 20 dot 1603192107570 dot 1799 at laptop-mg dot saclay dot inria dot fr>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
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.edlinger@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.