Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Mar 2021 18:45:10 GMT
From:      Alex Richardson <arichardson@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 05eac56a0432 - main - lib/msun: Fix x86 GCC6 build after 221622ec0c8e184
Message-ID:  <202103121845.12CIjAub046152@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by arichardson:

URL: https://cgit.FreeBSD.org/src/commit/?id=05eac56a0432d07acd7f159125855437a4dd6259

commit 05eac56a0432d07acd7f159125855437a4dd6259
Author:     Alex Richardson <arichardson@FreeBSD.org>
AuthorDate: 2021-03-12 18:44:42 +0000
Commit:     Alex Richardson <arichardson@FreeBSD.org>
CommitDate: 2021-03-12 18:44:44 +0000

    lib/msun: Fix x86 GCC6 build after 221622ec0c8e184
    
    Apparently GCC only supports arithmetic expressions that use static
    const variables in initializers starting with GCC8. To keep older
    versions happy use a macro instead.
    
    Fixes:          221622ec0c ("lib/msun: Avoid FE_INEXACT for x86 log2l/log10l")
    Reported by:    Jenkins
    Reviewed By:    imp
    Differential Revision: https://reviews.freebsd.org/D29233
---
 lib/msun/ld80/s_logl.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/msun/ld80/s_logl.c b/lib/msun/ld80/s_logl.c
index d787b953fedb..c74519cafd69 100644
--- a/lib/msun/ld80/s_logl.c
+++ b/lib/msun/ld80/s_logl.c
@@ -674,14 +674,14 @@ logl(long double x)
 	RETURNSPI(&r);
 }
 
-static const double
-invln10_hi =  4.3429448190317999e-1,		/*  0x1bcb7b1526e000.0p-54 */
-invln10_lo =  7.1842412889749798e-14,		/*  0x1438ca9aadd558.0p-96 */
-invln10_lo_plus_hi = invln10_lo + invln10_hi,
-invln2_hi =  1.4426950408887933e0,		/*  0x171547652b8000.0p-52 */
-invln2_lo =  1.7010652264631490e-13,		/*  0x17f0bbbe87fed0.0p-95 */
-invln2_lo_plus_hi = invln2_lo + invln2_hi;
-
+/* Use macros since GCC < 8 rejects static const expressions in initializers. */
+#define	invln10_hi	4.3429448190317999e-1	/*  0x1bcb7b1526e000.0p-54 */
+#define	invln10_lo	7.1842412889749798e-14	/*  0x1438ca9aadd558.0p-96 */
+#define	invln2_hi	1.4426950408887933e0	/*  0x171547652b8000.0p-52 */
+#define	invln2_lo	1.7010652264631490e-13	/*  0x17f0bbbe87fed0.0p-95 */
+/* Let the compiler pre-calculate this sum to avoid FE_INEXACT at run time. */
+static const double invln10_lo_plus_hi = invln10_lo + invln10_hi;
+static const double invln2_lo_plus_hi = invln2_lo + invln2_hi;
 
 long double
 log10l(long double x)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103121845.12CIjAub046152>