]> Savannah Git Hosting - gnulib.git/commitdiff
Defeat -flto GCC optimization in math autoconf tests.
authorBruno Haible <bruno@clisp.org>
Sun, 18 Aug 2019 14:12:29 +0000 (16:12 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 18 Aug 2019 14:12:29 +0000 (16:12 +0200)
Reported by Tomasz Kłoczko <kloczko.tomasz@gmail.com>
at <https://savannah.gnu.org/bugs/?56109>.

* m4/mathfunc.m4 (gl_MATHFUNC): Mark function pointer as 'volatile'.
* m4/acosl.m4 (gl_FUNC_ACOSL): Likewise.
* m4/asinl.m4 (gl_FUNC_ASINL): Likewise.
* m4/atanl.m4 (gl_FUNC_ATANL): Likewise.
* m4/cosl.m4 (gl_FUNC_COSL): Likewise.
* m4/exp2.m4 (gl_FUNC_EXP2): Likewise.
* m4/expl.m4 (gl_FUNC_EXPL): Likewise.
* m4/expm1.m4 (gl_FUNC_EXPM1): Likewise.
* m4/expm1l.m4 (gl_FUNC_EXPM1L): Likewise.
* m4/sinl.m4 (gl_FUNC_SINL): Likewise.
* m4/sqrtl.m4 (gl_FUNC_SQRTL): Likewise.
* m4/tanl.m4 (gl_FUNC_TANL): Likewise.

13 files changed:
ChangeLog
m4/acosl.m4
m4/asinl.m4
m4/atanl.m4
m4/cosl.m4
m4/exp2.m4
m4/expl.m4
m4/expm1.m4
m4/expm1l.m4
m4/mathfunc.m4
m4/sinl.m4
m4/sqrtl.m4
m4/tanl.m4

index 1b051716821be148a54bb4135ca02da718097ca8..d5f96f814b64327d2d15f4611804d328584258eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2019-08-18  Bruno Haible  <bruno@clisp.org>
+
+       Defeat -flto GCC optimization in math autoconf tests.
+       Reported by Tomasz Kłoczko <kloczko.tomasz@gmail.com>
+       at <https://savannah.gnu.org/bugs/?56109>.
+       * m4/mathfunc.m4 (gl_MATHFUNC): Mark function pointer as 'volatile'.
+       * m4/acosl.m4 (gl_FUNC_ACOSL): Likewise.
+       * m4/asinl.m4 (gl_FUNC_ASINL): Likewise.
+       * m4/atanl.m4 (gl_FUNC_ATANL): Likewise.
+       * m4/cosl.m4 (gl_FUNC_COSL): Likewise.
+       * m4/exp2.m4 (gl_FUNC_EXP2): Likewise.
+       * m4/expl.m4 (gl_FUNC_EXPL): Likewise.
+       * m4/expm1.m4 (gl_FUNC_EXPM1): Likewise.
+       * m4/expm1l.m4 (gl_FUNC_EXPM1L): Likewise.
+       * m4/sinl.m4 (gl_FUNC_SINL): Likewise.
+       * m4/sqrtl.m4 (gl_FUNC_SQRTL): Likewise.
+       * m4/tanl.m4 (gl_FUNC_TANL): Likewise.
+
 2019-08-17  Bruno Haible  <bruno@clisp.org>
 
        windows-spin: Implement declared functions.
index 1e4223b8e7e1605fb7b9cebcc5968d211d9e9974..a15ff68bff898f234c95f42121a9c3d56cec0480 100644 (file)
@@ -1,4 +1,4 @@
-# acosl.m4 serial 8
+# acosl.m4 serial 9
 dnl Copyright (C) 2010-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,7 @@ AC_DEFUN([gl_FUNC_ACOSL],
              # define __NO_MATH_INLINES 1 /* for glibc */
              #endif
              #include <math.h>
-             long double (*funcptr) (long double) = acosl;
+             long double (* volatile funcptr) (long double) = acosl;
              long double x;]],
            [[return funcptr (x) > 1
                     || acosl (x) > 1;]])],
@@ -41,7 +41,7 @@ AC_DEFUN([gl_FUNC_ACOSL],
                # define __NO_MATH_INLINES 1 /* for glibc */
                #endif
                #include <math.h>
-               long double (*funcptr) (long double) = acosl;
+               long double (* volatile funcptr) (long double) = acosl;
                long double x;]],
              [[return funcptr (x) > 1
                       || acosl (x) > 1;]])],
index 40c8c94cc668883b667b7a458bd51a13b90f9650..0698bd90d37087e60802f83aeaf35b5c15c23a66 100644 (file)
@@ -1,4 +1,4 @@
-# asinl.m4 serial 8
+# asinl.m4 serial 9
 dnl Copyright (C) 2010-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,7 @@ AC_DEFUN([gl_FUNC_ASINL],
              # define __NO_MATH_INLINES 1 /* for glibc */
              #endif
              #include <math.h>
-             long double (*funcptr) (long double) = asinl;
+             long double (* volatile funcptr) (long double) = asinl;
              long double x;]],
            [[return funcptr (x) > 1
                     || asinl (x) > 1;]])],
@@ -41,7 +41,7 @@ AC_DEFUN([gl_FUNC_ASINL],
                # define __NO_MATH_INLINES 1 /* for glibc */
                #endif
                #include <math.h>
-               long double (*funcptr) (long double) = asinl;
+               long double (* volatile funcptr) (long double) = asinl;
                long double x;]],
              [[return funcptr (x) > 1
                       || asinl (x) > 1;]])],
index 171e5400e97e007d2bd5a3405d53617739e8b6ed..5e7294c391ba37d2ffee84c1ca804238eeca756e 100644 (file)
@@ -1,4 +1,4 @@
-# atanl.m4 serial 8
+# atanl.m4 serial 9
 dnl Copyright (C) 2010-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,7 @@ AC_DEFUN([gl_FUNC_ATANL],
              # define __NO_MATH_INLINES 1 /* for glibc */
              #endif
              #include <math.h>
-             long double (*funcptr) (long double) = atanl;
+             long double (* volatile funcptr) (long double) = atanl;
              long double x;]],
            [[return funcptr (x) > 1
                     || atanl (x) > 1;]])],
@@ -41,7 +41,7 @@ AC_DEFUN([gl_FUNC_ATANL],
                # define __NO_MATH_INLINES 1 /* for glibc */
                #endif
                #include <math.h>
-               long double (*funcptr) (long double) = atanl;
+               long double (* volatile funcptr) (long double) = atanl;
                long double x;]],
              [[return funcptr (x) > 1
                       || atanl (x) > 1;]])],
index 669070a7edd52d4537d4ccdb074946bb738582be..c078bdcafa01db4c14a2caa653f6323980fe4b3b 100644 (file)
@@ -1,4 +1,4 @@
-# cosl.m4 serial 8
+# cosl.m4 serial 9
 dnl Copyright (C) 2010-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,7 @@ AC_DEFUN([gl_FUNC_COSL],
              # define __NO_MATH_INLINES 1 /* for glibc */
              #endif
              #include <math.h>
-             long double (*funcptr) (long double) = cosl;
+             long double (* volatile funcptr) (long double) = cosl;
              long double x;]],
            [[return funcptr (x) > 0.4
                     || cosl (x) > 0.4;]])],
@@ -41,7 +41,7 @@ AC_DEFUN([gl_FUNC_COSL],
                # define __NO_MATH_INLINES 1 /* for glibc */
                #endif
                #include <math.h>
-               long double (*funcptr) (long double) = cosl;
+               long double (* volatile funcptr) (long double) = cosl;
                long double x;]],
              [[return funcptr (x) > 0.4
                       || cosl (x) > 0.4;]])],
index c5c58bd50bb50d6bc3d49473e462076595174d92..b6cf666f495200bfe1ca33c6927e2d52d7f152ab 100644 (file)
@@ -1,4 +1,4 @@
-# exp2.m4 serial 2
+# exp2.m4 serial 3
 dnl Copyright (C) 2010-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -26,7 +26,7 @@ AC_DEFUN([gl_FUNC_EXP2],
              "C"
              #endif
              double exp2 (double);
-             double (*funcptr) (double) = exp2;
+             double (* volatile funcptr) (double) = exp2;
              double x;]],
            [[return funcptr (x) > 1.5
                     || exp2 (x) > 1.5;]])],
@@ -50,7 +50,7 @@ AC_DEFUN([gl_FUNC_EXP2],
                "C"
                #endif
                double exp2 (double);
-               double (*funcptr) (double) = exp2;
+               double (* volatile funcptr) (double) = exp2;
                double x;]],
              [[return funcptr (x) > 1.5
                       || exp2 (x) > 1.5;]])],
index b233046438dd0f6e16e3476c4181c796f79a2066..0619a2d2ea49237d3701f75871e6851710cee92e 100644 (file)
@@ -1,4 +1,4 @@
-# expl.m4 serial 13
+# expl.m4 serial 14
 dnl Copyright (C) 2010-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -23,7 +23,7 @@ AC_DEFUN([gl_FUNC_EXPL],
              # define __NO_MATH_INLINES 1 /* for glibc */
              #endif
              #include <math.h>
-             long double (*funcptr) (long double) = expl;
+             long double (* volatile funcptr) (long double) = expl;
              long double x;]],
            [[return funcptr (x) > 1.5
                     || expl (x) > 1.5;]])],
@@ -42,7 +42,7 @@ AC_DEFUN([gl_FUNC_EXPL],
                # define __NO_MATH_INLINES 1 /* for glibc */
                #endif
                #include <math.h>
-               long double (*funcptr) (long double) = expl;
+               long double (* volatile funcptr) (long double) = expl;
                long double x;]],
              [[return funcptr (x) > 1.5
                       || expl (x) > 1.5;]])],
index 088018adb98917900bb3dcad549f18d1fae1649b..389c7dca4242dfe85f9c2bfeea598c7a44a8050f 100644 (file)
@@ -1,4 +1,4 @@
-# expm1.m4 serial 7
+# expm1.m4 serial 8
 dnl Copyright (C) 2010-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,7 @@ AC_DEFUN([gl_FUNC_EXPM1],
              # define __NO_MATH_INLINES 1 /* for glibc */
              #endif
              #include <math.h>
-             double (*funcptr) (double) = expm1;
+             double (* volatile funcptr) (double) = expm1;
              double x;]],
            [[return funcptr (x) > 0.5
                     || expm1 (x) > 0.5;]])],
@@ -41,7 +41,7 @@ AC_DEFUN([gl_FUNC_EXPM1],
                # define __NO_MATH_INLINES 1 /* for glibc */
                #endif
                #include <math.h>
-               double (*funcptr) (double) = expm1;
+               double (* volatile funcptr) (double) = expm1;
                double x;]],
              [[return funcptr (x) > 0.5
                       || expm1 (x) > 0.5;]])],
index 324b702cf1ae855da9db22cd110204adabbcf700..5d3a991f247517d1707128ff05cf410b9ec4b0fe 100644 (file)
@@ -1,4 +1,4 @@
-# expm1l.m4 serial 4
+# expm1l.m4 serial 5
 dnl Copyright (C) 2010-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -27,7 +27,7 @@ AC_DEFUN([gl_FUNC_EXPM1L],
              "C"
              #endif
              long double expm1l (long double);
-             long double (*funcptr) (long double) = expm1l;
+             long double (* volatile funcptr) (long double) = expm1l;
              long double x;]],
            [[return funcptr (x) > 0.5
                     || expm1l (x) > 0.5;]])],
@@ -51,7 +51,7 @@ AC_DEFUN([gl_FUNC_EXPM1L],
                "C"
                #endif
                long double expm1l (long double);
-               long double (*funcptr) (long double) = expm1l;
+               long double (* volatile funcptr) (long double) = expm1l;
                long double x;]],
              [[return funcptr (x) > 0.5
                       || expm1l (x) > 0.5;]])],
index 91b538a9a9287809805e66231e9083a064674c6e..b9a572683b30f7bfdcbcaedb0b82e19e93b1a656 100644 (file)
@@ -1,4 +1,4 @@
-# mathfunc.m4 serial 11
+# mathfunc.m4 serial 12
 dnl Copyright (C) 2010-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -60,7 +60,7 @@ AC_DEFUN([gl_MATHFUNC],
              #endif
              #include <math.h>
              $4
-             $2 (*funcptr) $3 = ]func[;
+             $2 (* volatile funcptr) $3 = ]func[;
              int i_ret;
              float f_ret;
              double d_ret;
@@ -85,7 +85,7 @@ AC_DEFUN([gl_MATHFUNC],
                #endif
                #include <math.h>
                $4
-               $2 (*funcptr) $3 = ]func[;
+               $2 (* volatile funcptr) $3 = ]func[;
                int i_ret;
                float f_ret;
                double d_ret;
index 975ea52cea4e29600fcd53f52a84d81a35c54967..b3599ef5ea8f4bbe001e0d95d0e8b6c417a05f44 100644 (file)
@@ -1,4 +1,4 @@
-# sinl.m4 serial 8
+# sinl.m4 serial 9
 dnl Copyright (C) 2010-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,7 @@ AC_DEFUN([gl_FUNC_SINL],
              # define __NO_MATH_INLINES 1 /* for glibc */
              #endif
              #include <math.h>
-             long double (*funcptr) (long double) = sinl;
+             long double (* volatile funcptr) (long double) = sinl;
              long double x;]],
            [[return funcptr (x) > 0.4
                     || sinl (x) > 0.4;]])],
@@ -41,7 +41,7 @@ AC_DEFUN([gl_FUNC_SINL],
                # define __NO_MATH_INLINES 1 /* for glibc */
                #endif
                #include <math.h>
-               long double (*funcptr) (long double) = sinl;
+               long double (* volatile funcptr) (long double) = sinl;
                long double x;]],
              [[return funcptr (x) > 0.4
                       || sinl (x) > 0.4;]])],
index 31e94ff06a86347f19aab9e4bb8dccc3b328083a..af15c0f1d854db31cede2b1efcfde5d9cae242ef 100644 (file)
@@ -1,4 +1,4 @@
-# sqrtl.m4 serial 10
+# sqrtl.m4 serial 11
 dnl Copyright (C) 2010-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,7 @@ AC_DEFUN([gl_FUNC_SQRTL],
              # define __NO_MATH_INLINES 1 /* for glibc */
              #endif
              #include <math.h>
-             long double (*funcptr) (long double) = sqrtl;
+             long double (* volatile funcptr) (long double) = sqrtl;
              long double x;]],
            [[return funcptr (x) > 0.4
                     || sqrtl (x) > 0.4;]])],
@@ -41,7 +41,7 @@ AC_DEFUN([gl_FUNC_SQRTL],
                # define __NO_MATH_INLINES 1 /* for glibc */
                #endif
                #include <math.h>
-               long double (*funcptr) (long double) = sqrtl;
+               long double (* volatile funcptr) (long double) = sqrtl;
                long double x;]],
              [[return funcptr (x) > 0.4
                       || sqrtl (x) > 0.4;]])],
index 4a45a7ae172487648b54ff7e20cbca31f85cb036..8cd75fb15a66afc45aa843e562b4a0bc2b79564f 100644 (file)
@@ -1,4 +1,4 @@
-# tanl.m4 serial 8
+# tanl.m4 serial 9
 dnl Copyright (C) 2010-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,7 @@ AC_DEFUN([gl_FUNC_TANL],
              # define __NO_MATH_INLINES 1 /* for glibc */
              #endif
              #include <math.h>
-             long double (*funcptr) (long double) = tanl;
+             long double (* volatile funcptr) (long double) = tanl;
              long double x;]],
            [[return funcptr (x) > 0.4
                     || tanl (x) > 0.4;]])],
@@ -41,7 +41,7 @@ AC_DEFUN([gl_FUNC_TANL],
                # define __NO_MATH_INLINES 1 /* for glibc */
                #endif
                #include <math.h>
-               long double (*funcptr) (long double) = tanl;
+               long double (* volatile funcptr) (long double) = tanl;
                long double x;]],
              [[return funcptr (x) > 0.4
                       || tanl (x) > 0.4;]])],