On Mon, May 12, 2025 at 11:42 AM Tobias Burnus <tbur...@baylibre.com> wrote: > > C23 added the sinpi, cospi, etc. functions. Therefore, MPFR in 4.2.0 > added the mpfr_ counter parts. I assume that those internally use the > mpfr_sinu, mpfr_cosu, ... functions, which are also user accessible. > > In any case, MPFR makes the ...u functions available and explicitly > documents that for u = 360, the mpfr_...u functions permits to use > angles in degree instead of rad. > > Fortran 2023 added degree trigonometric functions, which gfortran already > supports. Thus: > > The attach patch switches to the mpfr_...u functions for the degree > variant if MPFR 4.2.0, but keeps the fallback for older MPFR versions. > > [Currently, GCC requires MPFR 3.1 or newer for build. (MPFR 4.2.0 was > releasedJanuary 2023.) We already did likewise in the past: Making > conditionally use of newer MPFR functions, if available, but have a > fallback until the minimal MPFR version is increased. (The last such > code was removed 2008 as then MPFR >= 3.1.0 was the new minimal > version and all of MPFR is currently used unconditionally.)] > > > Bootstrapped and regtested on x86_64-gnu-linux with MPFR 4.2.2 (the latest). > OK for mainline?
I'll note that download_prerequesites will still fetch MPFR 4.1.0, we should update that so this code path is exercised for people using the script. Can you at least open a bugreport for bumping the versions in the script? It always requires quite some validation of what we do at configure time for in-tree builds. Richard. > > Tobias > > PS: I see gfortran.dg/specifics_1.f90 fails for -O2 and higher, but not > due to this patch → https://gcc.gnu.org/PR120099 (opened on Apr 2025)