From: Bruno Haible Date: Sun, 18 Aug 2019 14:12:29 +0000 (+0200) Subject: Defeat -flto GCC optimization in math autoconf tests. X-Git-Tag: v1.0~4709 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=bdf8b1d2b74e12648edafffcda43832bc35e3d1f;p=gnulib.git Defeat -flto GCC optimization in math autoconf tests. Reported by Tomasz Kłoczko at . * 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. --- diff --git a/ChangeLog b/ChangeLog index 1b05171682..d5f96f814b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2019-08-18 Bruno Haible + + Defeat -flto GCC optimization in math autoconf tests. + Reported by Tomasz Kłoczko + at . + * 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 windows-spin: Implement declared functions. diff --git a/m4/acosl.m4 b/m4/acosl.m4 index 1e4223b8e7..a15ff68bff 100644 --- a/m4/acosl.m4 +++ b/m4/acosl.m4 @@ -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 - 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 - long double (*funcptr) (long double) = acosl; + long double (* volatile funcptr) (long double) = acosl; long double x;]], [[return funcptr (x) > 1 || acosl (x) > 1;]])], diff --git a/m4/asinl.m4 b/m4/asinl.m4 index 40c8c94cc6..0698bd90d3 100644 --- a/m4/asinl.m4 +++ b/m4/asinl.m4 @@ -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 - 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 - long double (*funcptr) (long double) = asinl; + long double (* volatile funcptr) (long double) = asinl; long double x;]], [[return funcptr (x) > 1 || asinl (x) > 1;]])], diff --git a/m4/atanl.m4 b/m4/atanl.m4 index 171e5400e9..5e7294c391 100644 --- a/m4/atanl.m4 +++ b/m4/atanl.m4 @@ -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 - 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 - long double (*funcptr) (long double) = atanl; + long double (* volatile funcptr) (long double) = atanl; long double x;]], [[return funcptr (x) > 1 || atanl (x) > 1;]])], diff --git a/m4/cosl.m4 b/m4/cosl.m4 index 669070a7ed..c078bdcafa 100644 --- a/m4/cosl.m4 +++ b/m4/cosl.m4 @@ -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 - 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 - 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;]])], diff --git a/m4/exp2.m4 b/m4/exp2.m4 index c5c58bd50b..b6cf666f49 100644 --- a/m4/exp2.m4 +++ b/m4/exp2.m4 @@ -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;]])], diff --git a/m4/expl.m4 b/m4/expl.m4 index b233046438..0619a2d2ea 100644 --- a/m4/expl.m4 +++ b/m4/expl.m4 @@ -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 - 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 - 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;]])], diff --git a/m4/expm1.m4 b/m4/expm1.m4 index 088018adb9..389c7dca42 100644 --- a/m4/expm1.m4 +++ b/m4/expm1.m4 @@ -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 - 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 - double (*funcptr) (double) = expm1; + double (* volatile funcptr) (double) = expm1; double x;]], [[return funcptr (x) > 0.5 || expm1 (x) > 0.5;]])], diff --git a/m4/expm1l.m4 b/m4/expm1l.m4 index 324b702cf1..5d3a991f24 100644 --- a/m4/expm1l.m4 +++ b/m4/expm1l.m4 @@ -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;]])], diff --git a/m4/mathfunc.m4 b/m4/mathfunc.m4 index 91b538a9a9..b9a572683b 100644 --- a/m4/mathfunc.m4 +++ b/m4/mathfunc.m4 @@ -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 $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 $4 - $2 (*funcptr) $3 = ]func[; + $2 (* volatile funcptr) $3 = ]func[; int i_ret; float f_ret; double d_ret; diff --git a/m4/sinl.m4 b/m4/sinl.m4 index 975ea52cea..b3599ef5ea 100644 --- a/m4/sinl.m4 +++ b/m4/sinl.m4 @@ -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 - 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 - 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;]])], diff --git a/m4/sqrtl.m4 b/m4/sqrtl.m4 index 31e94ff06a..af15c0f1d8 100644 --- a/m4/sqrtl.m4 +++ b/m4/sqrtl.m4 @@ -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 - 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 - 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;]])], diff --git a/m4/tanl.m4 b/m4/tanl.m4 index 4a45a7ae17..8cd75fb15a 100644 --- a/m4/tanl.m4 +++ b/m4/tanl.m4 @@ -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 - 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 - 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;]])],