The code setting the floating point exception mask in NSObject is incorrect. It works coincidentally with GCC because GCC (at least, in current versions) adds an extra load and so the argument becomes %eax. If it is an indirect address then this code will not work due to the extra brackets (it will complain about unexpected characters in the assembler). Attached is a fix.

David

Index: NSObject.m
===================================================================
--- NSObject.m  (revision 27773)
+++ NSObject.m  (working copy)
@@ -1138,9 +1138,9 @@
       {
        volatile short cw;

-       __asm__ volatile ("fstcw (%0)" : : "g" (&cw));
+       __asm__ volatile ("fstcw %0" : : "g" (&cw));
        cw |= 1; /* Mask 'invalid' exception */
-       __asm__ volatile ("fldcw (%0)" : : "g" (&cw));
+       __asm__ volatile ("fldcw %0" : : "g" (&cw));
       }
 #endif




_______________________________________________
Gnustep-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to