Am 14.05.25 um 08:42 schrieb FX Coudert:
[…] more trigonometric
functions changes are coming, I think it would be useful to agree
that this is a good approach.
Patch is OK to push.

Thanks for the review.

However, I messed up with 'git add' at some point and committed now a
version that didn't include one change, which only showed up after
the commit :-(

Contrary to all the other calls, for tand, the argument is massaged
(x → x+90°) before the call, hence x->value.real had to be changed
to result->value.real to use the modified result in mpfr_tanu.

Committed as r16-607-gc91c226762b422 and then the fix in
r16-608-gaac78fde6aa6ae.

Tobias
commit aac78fde6aa6ae829679355bc2a65bcadd834e6f
Author: Tobias Burnus <tbur...@baylibre.com>
Date:   Wed May 14 09:18:09 2025 +0200

    Fortran: Fix mpfr_tanu use in gfc_simplify_cotand with mpfr 4.2.0+ [PR120225]
    
    Fix commit r16-607-gc91c226762b422.
    
    gcc/fortran/ChangeLog:
    
            PR fortran/120225
            * simplify.cc (gfc_simplify_cotand): Fix used argument in
            mpfr_tanu call.

diff --git a/gcc/fortran/simplify.cc b/gcc/fortran/simplify.cc
index 79701be839d..1927097c190 100644
--- a/gcc/fortran/simplify.cc
+++ b/gcc/fortran/simplify.cc
@@ -2114,7 +2114,7 @@ gfc_simplify_cotand (gfc_expr *x)
   mpfr_set (result->value.real, x->value.real, GFC_RND_MODE);
   mpfr_add_ui (result->value.real, result->value.real, 90, GFC_RND_MODE);
 #if MPFR_VERSION >= MPFR_VERSION_NUM(4,2,0)
-  mpfr_tanu (result->value.real, x->value.real, 360, GFC_RND_MODE);
+  mpfr_tanu (result->value.real, result->value.real, 360, GFC_RND_MODE);
 #else
   simplify_tand (result->value.real);
 #endif

Reply via email to