From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3FE8D3858CDB; Sat, 30 Dec 2023 00:56:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3FE8D3858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703897784; bh=NmHfJdlmDP/2rD0IVd4t0JCo/hEhBVFX/aUKZ7IRHdw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FGtXqeSg3A3IeSs8jjCBcVBlfhWxlI21kHQrIiitiOLXJVQt2ZbQtXc4x81d7crYW /PRoWiy1ynMwc0NJXxHE2vb30BBJKrzIftvm4+8gcTcPjZoS8bTcZRpgd8TwTqkTSg BzxlicpFn+q7/Kgi+LNagkUpRSsPpvQBXxfDivyU= From: "sgk at troutmask dot apl.washington.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/113152] Fortran 2023 half-cycle trigonometric functions Date: Sat, 30 Dec 2023 00:56:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 13.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: P4 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113152 --- Comment #11 from Steve Kargl = --- On Fri, Dec 29, 2023 at 08:34:38PM +0000, anlauf at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113152 >=20 > --- Comment #10 from anlauf at gcc dot gnu.org --- > (In reply to kargl from comment #0) > > Created attachment 56949 [details] > > patch with implementation >=20 > Not a review, just a comment: >=20 > diff --git a/gcc/fortran/simplify.cc b/gcc/fortran/simplify.cc > index 87fefe46cfd..4e546ddb8fa 100644 > --- a/gcc/fortran/simplify.cc > +++ b/gcc/fortran/simplify.cc > @@ -30,6 +30,14 @@ along with GCC; see the file COPYING3. If not see > #include "constructor.h" > #include "version.h" /* For version_string. */ >=20 > +/* MPFR 4.2.0 introduced half-cycle trigonometric functions, e.g., sinpi= (x). > + Introduce a macro so older versions of the MPFR can still be used. */ > + > +#ifdef MPFR_HALF_CYCLE > +#undef MPFR_HALF_CYCLE > +#endif > +#define MPFR_HALF_CYCLE (MPFR_VERSION_MAJOR > 3 && MPFR_VERSION_MINOR > = 1) > + > /* Prototypes. */ >=20 >=20 > This does not look right, as it would exclude e.g. all mpfr-[5-9].[01] > How about: >=20 > #define MPFR_HALF_CYCLE (MPFR_VERSION_MAJOR * 100 + MPFR_VERSION_MINOR >= =3D 402) >=20 Indeed, it looks like I'm skipping all .0 and .1 minor releases. I'll adopt your suggestion, and include it in an updated patch.=