summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/dbl-64/s_log1p.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/dbl-64/s_log1p.c')
-rw-r--r--sysdeps/ieee754/dbl-64/s_log1p.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_log1p.c b/sysdeps/ieee754/dbl-64/s_log1p.c
index 340f6377f7..e6476a8260 100644
--- a/sysdeps/ieee754/dbl-64/s_log1p.c
+++ b/sysdeps/ieee754/dbl-64/s_log1p.c
@@ -80,7 +80,10 @@
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libc-diag.h>
static const double
ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */
@@ -191,5 +194,14 @@ __log1p (double x)
if (k == 0)
return f - (hfsq - s * (hfsq + R));
else
- return k * ln2_hi - ((hfsq - (s * (hfsq + R) + (k * ln2_lo + c))) - f);
+ {
+ /* With GCC 7 when compiling with -Os the compiler warns that c
+ might be used uninitialized. This can't be true because k
+ must be 0 for c to be uninitialized and we handled that
+ computation earlier without using c. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
+ return k * ln2_hi - ((hfsq - (s * (hfsq + R) + (k * ln2_lo + c))) - f);
+ DIAG_POP_NEEDS_COMMENT;
+ }
}