Bug 89598 - [9 Regression] go frontend fails to build against mpfr 2.4.2
Summary: [9 Regression] go frontend fails to build against mpfr 2.4.2
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: go (show other bugs)
Version: 9.0
: P1 normal
Target Milestone: 9.0
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-05 17:50 UTC by David Malcolm
Modified: 2019-03-06 15:56 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2019-03-05 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Malcolm 2019-03-05 17:50:47 UTC
I'm building gcc against mpfr-2.4.2.tar.bz2, which is the minimum version stated at:
  https://gcc.gnu.org/install/prerequisites.html
which says "MPFR Library version 2.4.2 (or later)".

I'm seeing build failures of the form:

../../../src/gcc/go/gofrontend/expressions.cc: In member function ‘unsigned int Numeric_constant::hash(unsigned int) const’:
../../../src/gcc/go/gofrontend/expressions.cc:17290:40: error: ‘MPFR_RNDN’ was not declared in this scope; did you mean ‘GMP_RNDN’?
17290 |       mpc_abs(m, this->u_.complex_val, MPFR_RNDN);
      |                                        ^~~~~~~~~
      |                                        GMP_RNDN

The usage of MPFR_RNDN was added in r269242 (akak 0ab323427675e178efdefc397fa82f7f8530a182), in Numeric_constant::hash.

I note r244966 (aka17a58f8aef6dfbfaf7f360cce0524c7d82307a83) poisoned MPFR_RNDN, in favor of using GMP_RNDN for compat with older MPFRs; presumably that should be done here?

(See also this thread: https://gcc.gnu.org/ml/gcc-patches/2019-02/msg01767.html )
Comment 1 ian@gcc.gnu.org 2019-03-05 19:42:18 UTC
Author: ian
Date: Tue Mar  5 19:41:42 2019
New Revision: 269399

URL: https://gcc.gnu.org/viewcvs?rev=269399&root=gcc&view=rev
Log:
	PR go/89598
    compiler: use GMP_RNDN rather than MPFR_RNDN
    
    This fixes the build with mpfr 2.4.2.
    
    Fixes https://gcc.gnu.org/PR89598
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/165418

Modified:
    trunk/gcc/go/gofrontend/MERGE
    trunk/gcc/go/gofrontend/expressions.cc
Comment 2 Ian Lance Taylor 2019-03-05 20:01:19 UTC
Fixed, I hope.
Comment 3 David Malcolm 2019-03-05 20:32:53 UTC
Sadly no, I still get:

../../../src/gcc/go/gofrontend/expressions.cc: In member function ‘unsigned int Numeric_constant::hash(unsigned int) const’:
../../../src/gcc/go/gofrontend/expressions.cc:17295:51: error: ‘MPFR_RNDN’ was not declared in this scope; did you mean ‘GMP_RNDN’?
17295 |       f = mpfr_get_d_2exp(&e, this->u_.float_val, MPFR_RNDN) * 4294967295.0;
      |                                                   ^~~~~~~~~
      |                                                   GMP_RNDN


I *think* that's the only remaining one.
Comment 4 ian@gcc.gnu.org 2019-03-06 05:02:48 UTC
Author: ian
Date: Wed Mar  6 05:02:16 2019
New Revision: 269411

URL: https://gcc.gnu.org/viewcvs?rev=269411&root=gcc&view=rev
Log:
	PR go/89598
    compiler: use GMP_RNDN rather than MPFR_RNDN
    
    Missed one last time around.  This fixes the build with mpfr 2.4.2.
    
    Fixes https://gcc.gnu.org/PR89598
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/165420

Modified:
    trunk/gcc/go/gofrontend/MERGE
    trunk/gcc/go/gofrontend/expressions.cc
Comment 5 Ian Lance Taylor 2019-03-06 05:05:07 UTC
This time for sure.
Comment 6 David Malcolm 2019-03-06 15:56:53 UTC
(In reply to Ian Lance Taylor from comment #5)
> This time for sure.

Indeed: r269411 did fix the build against mpfr 2.4.2 for my test config.

Thanks.