summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/flt-32/s_log1pf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/flt-32/s_log1pf.c')
-rw-r--r--sysdeps/ieee754/flt-32/s_log1pf.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sysdeps/ieee754/flt-32/s_log1pf.c b/sysdeps/ieee754/flt-32/s_log1pf.c
index ade60a2e27..a06190a589 100644
--- a/sysdeps/ieee754/flt-32/s_log1pf.c
+++ b/sysdeps/ieee754/flt-32/s_log1pf.c
@@ -15,7 +15,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 float
ln2_hi = 6.9313812256e-01, /* 0x3f317180 */
@@ -97,6 +100,18 @@ __log1pf(float x)
s = f/((float)2.0+f);
z = s*s;
R = z*(Lp1+z*(Lp2+z*(Lp3+z*(Lp4+z*(Lp5+z*(Lp6+z*Lp7))))));
- if(k==0) return f-(hfsq-s*(hfsq+R)); else
- return k*ln2_hi-((hfsq-(s*(hfsq+R)+(k*ln2_lo+c)))-f);
+ if (k == 0)
+ return f - (hfsq - s * (hfsq + R));
+ else
+ {
+ /* 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;
+ }
}