https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113152

--- 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 >= 402)

Reply via email to