Assaf Gordon wrote:
1. Based on a long list of GCC builtins
(https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html), perhaps add
"-fno-builtin" to all the gnulib tests? or at least the math related ones?
That'd have to be done conditionally, no? Not every compiler supports
-fno-builtin. And perhaps the tests should be done once with -fno-builtin, and
once without. This is lower priority than #2, tho.
2. Similar to 'gl_cv_func_expl_buggy' in 'm4/expl.m4',
add 'gl_cv_func_ceill_buggy' in 'm4/ceill.m4'.
Possible patch attached (tested on OpenBSD5.7+gcc 4.2.1, but not much
elsewhere).
If I understand you correctly the patch detects the bug only when compiling with
CFLAGS='-g -O0 -fno-builtin' or something like that. Can you redo the patch so
that it detects the bug with the default CFLAGS and GCC? Something like the
following, say:
#include <math.h>
long double d = 0.3;
int main (void) { return ceill (d) != 1; }
so that the compiler can't constant-fold the ceill call.