From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CF0B8385DC23; Wed, 15 Apr 2020 18:14:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF0B8385DC23 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1586974474; bh=yM/Y0k3VZKr9fgI1u48z7x8oRgHNqFMB9+Y/uTADWW0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bAVyXleVjP0K8BRmiHBwl/N75L1gY8W24TZfHJa3wM3MQkJo0Rhr3O1Me74UoNfrD ASlh9jm01o75fynbWJisVV7UsXWXmhU0pL9szAplCeR8S0O3hYrQqmK6hSFWFFgfor IpS97gJadEuO/y/wrT66InflLaHfGY5ycqA4xgPc= From: "sgk at troutmask dot apl.washington.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/94586] trigd_lib.inc:84:28: error: implicit declaration of function 'fmaf' Date: Wed, 15 Apr 2020 18:14:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2020 18:14:34 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94586 --- Comment #14 from Steve Kargl = --- On Wed, Apr 15, 2020 at 03:28:29PM +0000, dave.anglin at bell dot net wrote: >=20 > On 2020-04-15 11:02 a.m., sgk at troutmask dot apl.washington.edu wrote: > >=20 > > #if defined(HAVE_GFC_REAL_16) > > # if defined(HAVE_GFC_REAL_10) > > # define GFC_REAL_16_IS_FLOAT128 > > # if !defined(HAVE_FLOAT128) > > # error "Where has __float128 gone?" > > # endif > > # else > > # define GFC_REAL_16_IS_LONG_DOUBLE > > # endif > > #endif > >=20 > > So, hpux does not have REAL(10) and has REAL(16). This is doing > > what it is designed to do based on the assumption that a target > > like hpux with REAL(16) will define the long double functions=20 > > with the 'l' suffix. It seems the the fix for hpux is to change > > the test to something like=20 > >=20 > > # if defined(HAVE_GFC_REAL_10) || defined(__HPUX__) > >=20 > > using, of course, whatever the relevant macro. This will then > > select the 'q' suffix. >=20 > I tried the above approach yesterday but it led to a couple of undefined > symbols in libgfortran that > caused a new test fail. Possibly, the above might be a better overall ap= proach It likely is the start of an approach, but it seems hpux is conflating=20 long double and __float128, where it flips between an 'l' and 'q' suffix. gfortran simply assumes a correspondence with C types and C99 naming conventions (e.g., sinf, sin, and sinl). If a target has REAL(4), REAL(8), REAL(10), and REAL(16) the correspondence is float, double, long double, and __float128, respectively. If a target has REAL(4), REAL(8), and REAL(1= 6), then the correspondence is float, double, and long double. There is no __float128, and by extension, no functions with a 'q' suffix. The long double math function will end in 'l'. > but this is what I ended > up doing last night: >=20 > diff --git a/libgfortran/intrinsics/trigd.c b/libgfortran/intrinsics/trig= d.c > index 81699069545..970c60952ee 100644 > --- a/libgfortran/intrinsics/trigd.c > +++ b/libgfortran/intrinsics/trigd.c > @@ -27,6 +27,10 @@ see the files COPYING3 and COPYING.RUNTIME respectivel= y. If > not, see >=20 > #include >=20 > +#if (_POSIX_VERSION < 200112L) > +#define fmaf(a,b,c) ((a)*(b)+(c)) > +#define fma(a,b,c) ((a)*(b)+(c)) > +#endif >=20 > /* > For real x, let {x}_P or x_P be the closest representible number in t= he > @@ -169,7 +173,7 @@ see the files COPYING3 and COPYING.RUNTIME respective= ly.=20 > If not, see > #define COSD cosd_r16 > #define TAND tand_r16 >=20 > -#ifdef GFC_REAL_16_IS_FLOAT128 /* libquadmath. */ > +#if defined(GFC_REAL_16_IS_FLOAT128) || !defined(HAVE_COSL) /* libquadma= th.=20 > */ > #define SUFFIX(x) x ## q > #else > #define SUFFIX(x) x ## l >=20 > This fixed build of trigd.c. I think I need to do something similar to f= ix > dec_math.f90: >=20 > FAIL: gfortran.dg/dec_math.f90 -O0 (test for excess errors) > Excess errors: > /usr/ccs/bin/ld: Unsatisfied symbols: > tanl (first referenced in /var/tmp//ccLGIJFM.o) (code) > asinl (first referenced in /var/tmp//ccLGIJFM.o) (code) > sinl (first referenced in /var/tmp//ccLGIJFM.o) (code) > acosl (first referenced in /var/tmp//ccLGIJFM.o) (code) > atanl (first referenced in /var/tmp//ccLGIJFM.o) (code) > atan2l (first referenced in /var/tmp//ccLGIJFM.o) (code) > cosl (first referenced in /var/tmp//ccLGIJFM.o) (code) >=20 > It's the only new fail. What does -fdump-tree-original show for function foo(x) real(16) foo, x foo =3D cos(x) end function foo=