bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* expm1l: Fix configure test result with GCC 10 on powerpc64le
@ 2021-01-24  8:05 Bruno Haible
  0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2021-01-24  8:05 UTC (permalink / raw)
  To: bug-gnulib

On Alpine Linux 3.13/powerpc64le, configure reports
  checking whether expm1l works... no
but the function in fact works. The issue is caused by a GCC optimization.

This patch fixes it.


2021-01-24  Bruno Haible  <bruno@clisp.org>

	expm1l: Fix configure test result with GCC 10 on powerpc64le.
	* m4/expm1l.m4 (gl_FUNC_EXPM1L): Change test to avoid GCC optimization.

diff --git a/m4/expm1l.m4 b/m4/expm1l.m4
index 0eaaf84..8fe31b5 100644
--- a/m4/expm1l.m4
+++ b/m4/expm1l.m4
@@ -1,4 +1,4 @@
-# expm1l.m4 serial 7
+# expm1l.m4 serial 8
 dnl Copyright (C) 2010-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -134,7 +134,8 @@ int main (int argc, char *argv[])
     long double x = 11.358L;
     long double y = my_expm1l (x);
     long double z = my_expm1l (- x);
-    long double err = (y + (1.0L + y) * z) * TWO_LDBL_MANT_DIG;
+    volatile long double t = (1.0L + y) * z;
+    long double err = (y + t) * TWO_LDBL_MANT_DIG;
     if (!(err >= -100.0L && err <= 100.0L))
       result |= 1;
   }



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-24  8:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-24  8:05 expm1l: Fix configure test result with GCC 10 on powerpc64le Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).