Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20261111042105.4002620-1-khem.raj@oss.qualcomm.com>
Date: Tue, 10 Nov 2026 20:21:05 -0800
From: Khem Raj <raj.khem@...il.com>
To: musl@...ts.openwall.com
Cc: Khem Raj <khem.raj@....qualcomm.com>
Subject: [PATCH] math: disable FP contraction in jn.c

GCC does not contract floating point expressions in ISO C mode
(-std=c99), but clang contracts a*b+c into fma by default. In yn()
that turns the forward recurrence b = (2.0*i/x)*b - a into an fma,
which changes its rounding. Built with clang 23 for aarch64,
libc-test's math/yn then fails with

  yn(6, 0x1.8c5db097f7442p-1) want -0x1.6dbc18f9d5ddep+13
  got -0x1.6dbc18f9d5de1p+13, ulperr -3.219

Turn contraction off for this file, as GCC builds already have it.
---
 src/math/jn.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/math/jn.c b/src/math/jn.c
index 4878a54f..b077f020 100644
--- a/src/math/jn.c
+++ b/src/math/jn.c
@@ -35,6 +35,7 @@
  */
 
 #include "libm.h"
+#pragma STDC FP_CONTRACT OFF
 
 static const double invsqrtpi = 5.64189583547756279280e-01; /* 0x3FE20DD7, 0x50429B6D */
 

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.