This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATHCH] Disable inline asm for in-tree mpfr (PR69134)


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]