1 diff -pruN glibc-2.5-20061008T1257/sysdeps/x86_64/fpu/math_private.h glibc-2.5-20061008T1257.patched/sysdeps/x86_64/fpu/math_private.h
2 --- glibc-2.5-20061008T1257/sysdeps/x86_64/fpu/math_private.h 2013-02-12 07:05:08.000000000 -0500
3 +++ glibc-2.5-20061008T1257.patched/sysdeps/x86_64/fpu/math_private.h 2013-02-12 06:59:08.000000000 -0500
4 @@ -90,10 +90,14 @@ while (0)
5 #undef libc_feupdateenv
6 #define libc_feupdateenv(e) \
8 - unsigned int mxcsr; \
9 + unsigned int mxcsr, new_mxcsr; \
10 asm volatile ("stmxcsr %0" : "=m" (*&mxcsr)); \
11 - asm volatile ("ldmxcsr %0" : : "m" ((e)->__mxcsr)); \
12 - feraiseexcept (mxcsr & FE_ALL_EXCEPT); \
13 + /* Merge in the old exceptions. */ \
14 + new_mxcsr = mxcsr & FE_ALL_EXCEPT | (e)->__mxcsr; \
15 + asm volatile ("ldmxcsr %0" : : "m" (*&new_mxcsr)); \
16 + /* Only raise exception if there are any that are not masked. */ \
17 + if (~(mxcsr >> 7) & mxcsr & FE_ALL_EXCEPT) \
18 + feraiseexcept (mxcsr & FE_ALL_EXCEPT); \
20 #undef libc_feupdateenvf
21 #define libc_feupdateenvf(e) libc_feupdateenv (e)