From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hall.aurel32.net (hall.aurel32.net [IPv6:2001:bc8:30d7:100::1]) by sourceware.org (Postfix) with ESMTPS id 0BF06385C401 for ; Sun, 9 Oct 2022 11:06:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0BF06385C401 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=aurel32.net Authentication-Results: sourceware.org; spf=none smtp.mailfrom=aurel32.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=aurel32.net ; s=202004.hall; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date: Subject:Cc:To:From:Content-Type:From:Reply-To:Subject:Content-ID: Content-Description:In-Reply-To:References:X-Debbugs-Cc; bh=FyQH7ft7AGuWVFNamiuLeAoQgo/nclpWoQDOSY9V/FQ=; b=NXONg8YxrhNv/aAWaR7KQeR+cO dxT+hbzCAkLPzs5an4iIMIZAnk0C7peItNicMShFkR5Eedbp+lOHDbJF/f/U19YGYZ221eSV+HM3d IKwSgpL5EfgFoMlCCo/5ggFhXQRZ+h45ihytu0yYDRFnJwy62JdMSCx1PBBxtJGrEqklbL1pqU7Wd /IGqN77ZicSI9Wk8hN3PKGjPaXqNdqWJBDsLqSY0NK0Qi5T2oxMB3lFHibhibZcUsca7WV2JGPTHZ CJJcTK1BlIRnXXGYIeuY8fTbtV0U7A9wLDcj5CxWb85GpMWSrY1hxLbTBpmwYp9oET4uM1TIeXYk9 j1FX9c0Q==; Received: from [2a01:e34:ec5d:a741:8a4c:7c4e:dc4c:1787] (helo=ohm.rr44.fr) by hall.aurel32.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ohU8n-002cjX-Dw; Sun, 09 Oct 2022 13:06:41 +0200 Received: from aurel32 by ohm.rr44.fr with local (Exim 4.96) (envelope-from ) id 1ohU8l-00FFTt-1M; Sun, 09 Oct 2022 13:06:39 +0200 From: Aurelien Jarno To: libc-stable@sourceware.org Cc: Michael Hudson-Doyle , Wilco Dijkstra Subject: [COMMITTED 2.36] Ensure calculations happen with desired rounding mode in y1lf128 Date: Sun, 9 Oct 2022 13:06:30 +0200 Message-Id: <20221009110630.3634060-1-aurelien@aurel32.net> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,SPF_HELO_PASS,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Michael Hudson-Doyle math/test-float128-y1 fails on x86_64 and ppc64el with gcc 12 and -O3, because code inside a block guarded by SET_RESTORE_ROUNDL is being moved after the rounding mode has been restored. Use math_force_eval to prevent this (and insert some math_opt_barrier calls to prevent code from being moved before the rounding mode is set). Fixes #29463 Reviewed-By: Wilco Dijkstra (cherry picked from commit 2b274fd8c9c776cf70fcdb8356e678ada522a7b0) --- NEWS | 1 + sysdeps/ieee754/ldbl-128/e_j1l.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 63e26d7062..bea1d8a11f 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,7 @@ The following bugs are resolved with this release: [29446] _dlopen now ignores dl_caller argument in static mode [29485] Linux: Terminate subprocess on late failure in tst-pidfd [29490] alpha: New __brk_call implementation is broken + [29463] math/test-float128-y1 fails on x86_64 [29528] elf: Call __libc_early_init for reused namespaces [29537] libc: [2.34 regression]: Alignment issue on m68k when using [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c index 54c457681a..9a9c5c6f00 100644 --- a/sysdeps/ieee754/ldbl-128/e_j1l.c +++ b/sysdeps/ieee754/ldbl-128/e_j1l.c @@ -869,10 +869,13 @@ __ieee754_y1l (_Float128 x) { /* 0 <= x <= 2 */ SET_RESTORE_ROUNDL (FE_TONEAREST); + xx = math_opt_barrier (xx); + x = math_opt_barrier (x); z = xx * xx; p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D); p = -TWOOPI / xx + p; p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p; + math_force_eval (p); return p; } -- 2.35.1