[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patches] Fix MIPS feupdateenv miscompilation
- To: patches@xxxxxxxxxx
- Subject: [patches] Fix MIPS feupdateenv miscompilation
- From: "Joseph S. Myers" <joseph@xxxxxxxxxxxxxxxx>
- Date: Tue, 22 Jul 2008 19:24:26 +0000 (UTC)
I observed test-fenv failing for MIPS because feupdateenv had been
miscompiled to move the _FPU_GETCW call after that to fesetenv. I've
applied this patch to trunk and 2.8 branch to fix this by marking the
relevant asms volatile
Index: ports/sysdeps/mips/fpu_control.h
===================================================================
--- ports/sysdeps/mips/fpu_control.h (revision 6605)
+++ ports/sysdeps/mips/fpu_control.h (working copy)
@@ -100,8 +100,8 @@
typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
/* Macros for accessing the hardware control word. */
-#define _FPU_GETCW(cw) __asm__ ("cfc1 %0,$31" : "=r" (cw))
-#define _FPU_SETCW(cw) __asm__ ("ctc1 %0,$31" : : "r" (cw))
+#define _FPU_GETCW(cw) __asm__ volatile ("cfc1 %0,$31" : "=r" (cw))
+#define _FPU_SETCW(cw) __asm__ volatile ("ctc1 %0,$31" : : "r" (cw))
/* Default control word set at startup. */
extern fpu_control_t __fpu_control;
Index: ports/ChangeLog.eglibc
===================================================================
--- ports/ChangeLog.eglibc (revision 6605)
+++ ports/ChangeLog.eglibc (working copy)
@@ -1,3 +1,8 @@
+2008-07-22 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
+
+ * sysdeps/mips/fpu_control.h (_FPU_GETCW, _FPU_SETCW): Make asms
+ volatile.
+
2008-07-16 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
* sysdeps/mips/bits/setjmp.h (__jmp_buf): Give name to structure
--
Joseph S. Myers
joseph@xxxxxxxxxxxxxxxx