This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix MIPS feupdateenv miscompilation


I observed test-fenv failing for MIPS because feupdateenv had been
miscompiled to move the _FPU_GETCW call after that to fesetenv.  This
patch prevents that miscompilation by marking the relevant asms
volatile.

2008-07-22  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/mips/fpu_control.h (_FPU_GETCW, _FPU_SETCW): Make asms
	volatile.

Index: sysdeps/mips/fpu_control.h
===================================================================
RCS file: /cvs/glibc/ports/sysdeps/mips/fpu_control.h,v
retrieving revision 1.7
diff -u -r1.7 fpu_control.h
--- sysdeps/mips/fpu_control.h	21 Sep 2006 21:01:02 -0000	1.7
+++ sysdeps/mips/fpu_control.h	22 Jul 2008 19:25:11 -0000
@@ -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;

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]