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

--- Comment #11 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
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=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)
> 

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.
  • [Bug fortran/113152] ... sgk at troutmask dot apl.washington.edu via Gcc-bugs

Reply via email to