From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6098F3858D33; Fri, 29 Dec 2023 20:34:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6098F3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703882078; bh=CIDac8heGSwvoC8yzOcfmQTH62bj87zHstv6Ru6pA+A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iF7LZHbf8R0PQu7IIJedJqRDPdIYikeEmNwVEnd1/SHzdb5JnSj9EfAKPUz11UfmJ U9sDZRktqV/jblHBbZa2i+hDisjC1c1BfbOu0izejhFDJt06aOh9e66MxMQghw6v/r SoElnIpSagZTi1zDvAfVn8cf4hO78m5Sz5TPmY3Y= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/113152] Fortran 2023 half-cycle trigonometric functions Date: Fri, 29 Dec 2023 20:34:38 +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: anlauf at gcc dot gnu.org 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 #10 from anlauf at gcc dot gnu.org --- (In reply to kargl from comment #0) > Created attachment 56949 [details] > patch with implementation Not a review, just a comment: 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. */ +/* 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. */ This does not look right, as it would exclude e.g. all mpfr-[5-9].[01] How about: #define MPFR_HALF_CYCLE (MPFR_VERSION_MAJOR * 100 + MPFR_VERSION_MINOR >=3D= 402)=