]> Savannah Git Hosting - gnulib.git/commitdiff
floor, ceil, trunc, truncf, truncl: Defeat GCC optimizations.
authorBruno Haible <bruno@clisp.org>
Sun, 14 Oct 2018 07:27:21 +0000 (09:27 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 14 Oct 2018 07:34:49 +0000 (09:34 +0200)
* m4/floor.m4 (gl_FUNC_FLOOR_LIBS): Use 'floor' also through a function
pointer.
* m4/ceil.m4 (gl_FUNC_CEIL_LIBS): Use 'ceil' also through a function
pointer.
* m4/trunc.m4 (gl_FUNC_TRUNC): Use 'trunc' also through a function
pointer.
* m4/truncf.m4 (gl_FUNC_TRUNCF): Use 'truncf' also through a function
pointer.
* m4/truncl.m4 (gl_FUNC_TRUNCL): Use 'truncl' also through a function
pointer.

ChangeLog
m4/ceil.m4
m4/floor.m4
m4/trunc.m4
m4/truncf.m4
m4/truncl.m4

index ecd69df04ff8c5b8003258236d789741b4b38136..7ee522b5287fd3a17c91eb5356d4b1232d2a5b24 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2018-10-14  Bruno Haible  <bruno@clisp.org>
+
+       floor, ceil, trunc, truncf, truncl: Defeat GCC optimizations.
+       * m4/floor.m4 (gl_FUNC_FLOOR_LIBS): Use 'floor' also through a function
+       pointer.
+       * m4/ceil.m4 (gl_FUNC_CEIL_LIBS): Use 'ceil' also through a function
+       pointer.
+       * m4/trunc.m4 (gl_FUNC_TRUNC): Use 'trunc' also through a function
+       pointer.
+       * m4/truncf.m4 (gl_FUNC_TRUNCF): Use 'truncf' also through a function
+       pointer.
+       * m4/truncl.m4 (gl_FUNC_TRUNCL): Use 'truncl' also through a function
+       pointer.
+
 2018-10-13  Akim Demaille  <akim@lrde.epita.fr>
 
        bootstrap: fix wget command for po files.
index 592b3f2ee87d6cc78681dc979ff37703c889a128..87199ed11088c0fe86319b6d0fc243175e7c986a 100644 (file)
@@ -1,4 +1,4 @@
-# ceil.m4 serial 11
+# ceil.m4 serial 12
 dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -81,8 +81,9 @@ AC_DEFUN([gl_FUNC_CEIL_LIBS],
            # define __NO_MATH_INLINES 1 /* for glibc */
            #endif
            #include <math.h>
+           double (*funcptr) (double) = ceil;
            double x;]],
-         [[x = ceil(x);]])],
+         [[x = funcptr(x) + ceil(x);]])],
       [gl_cv_func_ceil_libm=])
     if test "$gl_cv_func_ceil_libm" = "?"; then
       save_LIBS="$LIBS"
@@ -93,8 +94,9 @@ AC_DEFUN([gl_FUNC_CEIL_LIBS],
              # define __NO_MATH_INLINES 1 /* for glibc */
              #endif
              #include <math.h>
+             double (*funcptr) (double) = ceil;
              double x;]],
-           [[x = ceil(x);]])],
+           [[x = funcptr(x) + ceil(x);]])],
         [gl_cv_func_ceil_libm="-lm"])
       LIBS="$save_LIBS"
     fi
index 15fa84d2b1a7fe1ae25cf58461c46d467d575dd0..bef45a1e0d24d65e5794b8b35efd8366b242d2cd 100644 (file)
@@ -1,4 +1,4 @@
-# floor.m4 serial 10
+# floor.m4 serial 11
 dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -77,8 +77,9 @@ AC_DEFUN([gl_FUNC_FLOOR_LIBS],
            # define __NO_MATH_INLINES 1 /* for glibc */
            #endif
            #include <math.h>
+           double (*funcptr) (double) = floor;
            double x;]],
-         [[x = floor(x);]])],
+         [[x = funcptr(x) + floor(x);]])],
       [gl_cv_func_floor_libm=])
     if test "$gl_cv_func_floor_libm" = "?"; then
       save_LIBS="$LIBS"
@@ -89,8 +90,9 @@ AC_DEFUN([gl_FUNC_FLOOR_LIBS],
              # define __NO_MATH_INLINES 1 /* for glibc */
              #endif
              #include <math.h>
+             double (*funcptr) (double) = floor;
              double x;]],
-           [[x = floor(x);]])],
+           [[x = funcptr(x) + floor(x);]])],
         [gl_cv_func_floor_libm="-lm"])
       LIBS="$save_LIBS"
     fi
index 7abb8ecb35ddcc9467f4d5c42ebce1b806d44428..1ff8f19d613891c557962d9d8b70941d050e0f10 100644 (file)
@@ -1,4 +1,4 @@
-# trunc.m4 serial 11
+# trunc.m4 serial 12
 dnl Copyright (C) 2007, 2010-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -21,8 +21,9 @@ AC_DEFUN([gl_FUNC_TRUNC],
            # define __NO_MATH_INLINES 1 /* for glibc */
            #endif
            #include <math.h>
+           double (*funcptr) (double) = trunc;
            double x;]],
-         [[x = trunc(x);]])],
+         [[x = funcptr(x) + trunc(x);]])],
       [TRUNC_LIBM=])
     if test "$TRUNC_LIBM" = "?"; then
       save_LIBS="$LIBS"
@@ -33,8 +34,9 @@ AC_DEFUN([gl_FUNC_TRUNC],
              # define __NO_MATH_INLINES 1 /* for glibc */
              #endif
              #include <math.h>
+             double (*funcptr) (double) = trunc;
              double x;]],
-           [[x = trunc(x);]])],
+           [[x = funcptr(x) + trunc(x);]])],
         [TRUNC_LIBM="-lm"])
       LIBS="$save_LIBS"
     fi
index fb4c5699c4faa2a0307d50cadbeee93b65118dbb..fdd36ec62b483a10e179eca27c913828b97110dc 100644 (file)
@@ -1,4 +1,4 @@
-# truncf.m4 serial 11
+# truncf.m4 serial 12
 dnl Copyright (C) 2007, 2010-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -21,8 +21,9 @@ AC_DEFUN([gl_FUNC_TRUNCF],
            # define __NO_MATH_INLINES 1 /* for glibc */
            #endif
            #include <math.h>
+           float (*funcptr) (float) = truncf;
            float x;]],
-         [[x = truncf(x);]])],
+         [[x = funcptr(x) + truncf(x);]])],
       [TRUNCF_LIBM=])
     if test "$TRUNCF_LIBM" = "?"; then
       save_LIBS="$LIBS"
@@ -33,8 +34,9 @@ AC_DEFUN([gl_FUNC_TRUNCF],
              # define __NO_MATH_INLINES 1 /* for glibc */
              #endif
              #include <math.h>
+             float (*funcptr) (float) = truncf;
              float x;]],
-           [[x = truncf(x);]])],
+           [[x = funcptr(x) + truncf(x);]])],
         [TRUNCF_LIBM="-lm"])
       LIBS="$save_LIBS"
     fi
index 39ed3c4ffa838aeaadfb44c339ffe935e534a9b7..14be186700082e656f1483a428b2ca92b8d23893 100644 (file)
@@ -1,4 +1,4 @@
-# truncl.m4 serial 13
+# truncl.m4 serial 14
 dnl Copyright (C) 2007-2008, 2010-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -25,8 +25,9 @@ AC_DEFUN([gl_FUNC_TRUNCL],
            # define __NO_MATH_INLINES 1 /* for glibc */
            #endif
            #include <math.h>
+           long double (*funcptr) (long double) = truncl;
            long double x;]],
-         [[x = truncl(x);]])],
+         [[x = funcptr(x) + truncl(x);]])],
       [TRUNCL_LIBM=])
     if test "$TRUNCL_LIBM" = "?"; then
       save_LIBS="$LIBS"
@@ -37,8 +38,9 @@ AC_DEFUN([gl_FUNC_TRUNCL],
              # define __NO_MATH_INLINES 1 /* for glibc */
              #endif
              #include <math.h>
+             long double (*funcptr) (long double) = truncl;
              long double x;]],
-           [[x = truncl(x);]])],
+           [[x = funcptr(x) + truncl(x);]])],
         [TRUNCL_LIBM="-lm"])
       LIBS="$save_LIBS"
     fi