From: Uros Bizjak Date: Wed, 24 Sep 2025 05:59:38 +0000 (+0200) Subject: x86: Restore "*&" GCC asm memory operand workaround to installed fpu-control.h X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9a8b106bb4c4f33d17ff4aba9b7381b87277d59;p=thirdparty%2Fglibc.git x86: Restore "*&" GCC asm memory operand workaround to installed fpu-control.h 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 --- diff --git a/sysdeps/x86/fpu_control.h b/sysdeps/x86/fpu_control.h index e8c08de9d5..967e8ca5c3 100644 --- a/sysdeps/x86/fpu_control.h +++ b/sysdeps/x86/fpu_control.h @@ -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;