Bionic: Aliasing problems with frexpf
This patch fixes a known bug in bionic libm
due to aliasing issues in gcc 4.2 and 4.4; more
specifically in frexpf.
The function frexpf is used to extract the
mantissa and exponent from a double precision number.
The bug has already been reported here:
https://code.google.com/p/android/issues/detail?id=6697
Change-Id: I2e1f2e0a45906642d2225b9d150ed391d2bf331c
Signed-off-by: Rodrigo Obregon <robregon@ti.com>
diff --git a/libm/src/s_frexpf.c b/libm/src/s_frexpf.c
index 89d464b..c18cd54 100644
--- a/libm/src/s_frexpf.c
+++ b/libm/src/s_frexpf.c
@@ -39,6 +39,6 @@
}
*eptr += (ix>>23)-126;
hx = (hx&0x807fffff)|0x3f000000;
- *(int*)&x = hx;
+ SET_FLOAT_WORD(x,hx);
return x;
}