From fddaafcedaac344845afd24f0b00660a846d0eba Mon Sep 17 00:00:00 2001 From: Rodrigo Obregon Date: Fri, 5 Nov 2010 12:15:26 -0500 Subject: [PATCH] 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 --- libm/src/s_frexpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libm/src/s_frexpf.c b/libm/src/s_frexpf.c index 89d464b4d..c18cd54c6 100644 --- a/libm/src/s_frexpf.c +++ b/libm/src/s_frexpf.c @@ -39,6 +39,6 @@ frexpf(float x, int *eptr) } *eptr += (ix>>23)-126; hx = (hx&0x807fffff)|0x3f000000; - *(int*)&x = hx; + SET_FLOAT_WORD(x,hx); return x; }