]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
x86: Restore "*&" GCC asm memory operand workaround to installed fpu-control.h
authorUros Bizjak <ubizjak@gmail.com>
Wed, 24 Sep 2025 05:59:38 +0000 (07:59 +0200)
committerUros Bizjak <ubizjak@gmail.com>
Wed, 24 Sep 2025 06:04:41 +0000 (08:04 +0200)
fpu_control.h is an installed header so a wider range of compiler versions
(including ones older than GCC 9) are relevant with it than are relevant
for building glibc.

Fixes commit 3014dec3ad47260283cfc8f7199b31c2ac3083f0
('x86: Remove obsolete "*&" GCC asm memory operand workaround')

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
sysdeps/x86/fpu_control.h

index e8c08de9d5ba07072650febeefc6356662af4670..967e8ca5c32cdc169714f6f0e5b60e8234b079ba 100644 (file)
@@ -89,7 +89,7 @@
 /* Type of the control word.  */
 typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__)));
 
-/* Macros for accessing the hardware control word.  "" is used to
+/* Macros for accessing the hardware control word.  "*&" is used to
    work around a bug in older versions of GCC.  __volatile__ is used
    to support combination of writing the control register and reading
    it back.  Without __volatile__, the old value may be used for reading
@@ -99,8 +99,8 @@ typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__)));
    recent hardware nor on x86-64.  Some floating point operations are
    executed in the SSE/SSE2 engines which have their own control and
    status register.  */
-#define _FPU_GETCW(cw) __asm__ __volatile__ ("fnstcw %0" : "=m" (cw))
-#define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (cw))
+#define _FPU_GETCW(cw) __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw))
+#define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw))
 
 /* Default control word set at startup.  */
 extern fpu_control_t __fpu_control;