diff options
author | Bruno Haible <bruno@clisp.org> | 2020-05-23 19:49:42 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-05-23 19:50:24 +0200 |
commit | f95e68ffaf3b2cf0725bcaa47f877fdcaae38ca8 (patch) | |
tree | 45903abb73b857777ef2474f5237225544eb92b2 | |
parent | 6e6abd0cdfe4bb96f6412aebc511f10bf254a820 (diff) | |
download | gnulib-f95e68ffaf3b2cf0725bcaa47f877fdcaae38ca8.tar.gz gnulib-f95e68ffaf3b2cf0725bcaa47f877fdcaae38ca8.tar.bz2 |
isnanl, isnanl-nolibm: Make a test work better with "gcc -O2" on x86_64.
* m4/exponentl.m4 (gl_LONG_DOUBLE_EXPONENT_LOCATION): Pass the
'long double' values by reference, with values taken from a statically
allocated array.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | m4/exponentl.m4 | 14 |
2 files changed, 13 insertions, 8 deletions
@@ -1,5 +1,12 @@ 2020-05-23 Bruno Haible <bruno@clisp.org> + isnanl, isnanl-nolibm: Make a test work better with "gcc -O2" on x86_64. + * m4/exponentl.m4 (gl_LONG_DOUBLE_EXPONENT_LOCATION): Pass the + 'long double' values by reference, with values taken from a statically + allocated array. + +2020-05-23 Bruno Haible <bruno@clisp.org> + findprog-in: Ignore directories. Reported by Frederick Eaton via Dmitry Goncharov in <https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00003.html>. diff --git a/m4/exponentl.m4 b/m4/exponentl.m4 index b33b3bff3e..0a35c119ee 100644 --- a/m4/exponentl.m4 +++ b/m4/exponentl.m4 @@ -1,4 +1,4 @@ -# exponentl.m4 serial 4 +# exponentl.m4 serial 5 dnl Copyright (C) 2007-2020 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,14 +22,14 @@ typedef union { long double value; unsigned int word[NWORDS]; } memory_long_double; static unsigned int ored_words[NWORDS]; static unsigned int anded_words[NWORDS]; -static void add_to_ored_words (long double x) +static void add_to_ored_words (long double *x) { memory_long_double m; size_t i; /* Clear it first, in case sizeof (long double) < sizeof (memory_long_double). */ memset (&m, 0, sizeof (memory_long_double)); - m.value = x; + m.value = *x; for (i = 0; i < NWORDS; i++) { ored_words[i] |= m.word[i]; @@ -38,17 +38,15 @@ static void add_to_ored_words (long double x) } int main () { + static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L }; size_t j; FILE *fp = fopen ("conftest.out", "w"); if (fp == NULL) return 1; for (j = 0; j < NWORDS; j++) anded_words[j] = ~ (unsigned int) 0; - add_to_ored_words (0.25L); - add_to_ored_words (0.5L); - add_to_ored_words (1.0L); - add_to_ored_words (2.0L); - add_to_ored_words (4.0L); + for (j = 0; j < 5; j++) + add_to_ored_words (&samples[j]); /* Remove bits that are common (e.g. if representation of the first mantissa bit is explicit). */ for (j = 0; j < NWORDS; j++) |