Index: Source/NSObject.m
===================================================================
--- Source/NSObject.m	(revision 28458)
+++ Source/NSObject.m	(working copy)
@@ -65,6 +65,9 @@
 #ifdef	HAVE_SYS_SIGNAL_H
 #include	<sys/signal.h>
 #endif
+#ifdef __FreeBSD__
+#include <fenv.h>
+#endif
 
 #include "GSPrivate.h"
 
@@ -971,14 +974,7 @@
       // Manipulate the FPU to add the exception mask. (Fixes SIGFPE
       // problems on *BSD)
       // Note this only works on x86
-
-      {
-	volatile short cw;
-
-	__asm__ volatile ("fstcw (%0)" : : "g" (&cw));
-	cw |= 1; /* Mask 'invalid' exception */
-	__asm__ volatile ("fldcw (%0)" : : "g" (&cw));
-      }
+      fedisableexcept(FE_INVALID);
 #endif
 
 
