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: [PATCH committed] Fix build failure with MPFR 2.4.x (gimple-ssa-sprintf.c)


Hi Jakub,

> On Fri, Jan 27, 2017 at 08:41:59AM +0100, Rainer Orth wrote:
>> > On 01/24/2017 02:37 AM, Markus Trippelsdorf wrote:
>> >> MPFR_RNDx was introduced in MPFR 3.0.0. Since the minimal version that
>> >> gcc checks for is 2.4.0, this leads to a build failure.
>> >>
>> >> The fix is straightforward.
>> >>
>> >> Tested on x86_64-pc-linux-gnu. Committed to trunk as obvious.
>> >>
>> >> 	* gimple-ssa-sprintf.c (format_floating): Change MPFR_RNDx to
>> >> 	GMP_RNDx for compatibility.
>> >
>> > This was changed once before for this reason (in r240350).  I forgot
>> > all about it and put it back in my latest patch for some reason.  I
>> > don't remember why exactly but I suspect I might have been trying to
>> > overcome some MPFR oddity.  It might help to #undef the MPFR_RNDx
>> > macros after including <mpfr.h> to avoid this in the future.  In any
>> > event, thanks for the fix.
>> 
>> we certainly should do something like this: your latest patch introduced
>> the same failure again:
>> 
>> /vol/gcc/src/hg/trunk/local/gcc/gimple-ssa-sprintf.c: In function 'long long unsigned int {anonymous}::format_floating_max(tree, char, long long int)':
>> /vol/gcc/src/hg/trunk/local/gcc/gimple-ssa-sprintf.c:1501:27: error: 'MPFR_RNDN' was not declared in this scope
>>    mpfr_from_real (x, &rv, MPFR_RNDN);
>>                            ^
>> Makefile:1098: recipe for target 'gimple-ssa-sprintf.o' failed
>> make[3]: *** [gimple-ssa-sprintf.o] Error 1
>
> So what about poisoning MPFR_RND{N,D,Z,U} then?
>
> With mpfr 3.1.5 it seems to work, both when using system gcc (6.3.1)
> and when building in stage3.  I don't have mpfr 2.4.* around and apparently
> it is incompatible with gmp 6.1.x, so I'd have to build both gmp and mpfr
> (and likely mpc too).  Can you just quickly try this if it works for you?

sure: just tried a sparc-sun-solaris2.12 bootstrap with gcc 4.9 and mpfr
2.4.2-p3.  Successfully built the stage1 and stage2 compilers.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


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