a2cf7d
commit 49bc41b64239c4726f31fa35a1af4f22fb41d51f
a2cf7d
Author: Paul A. Clarke <pc@us.ibm.com>
a2cf7d
Date:   Tue Jun 11 14:37:37 2019 -0500
a2cf7d
a2cf7d
    [powerpc] add 'volatile' to asm
a2cf7d
    
a2cf7d
    Add 'volatile' keyword to a few asm statements, to force the compiler
a2cf7d
    to generate the instructions therein.
a2cf7d
    
a2cf7d
    Some instances were implicitly volatile, but adding keyword for consistency.
a2cf7d
    
a2cf7d
    2019-06-19  Paul A. Clarke  <pc@us.ibm.com>
a2cf7d
    
a2cf7d
            * sysdeps/powerpc/fpu/fenv_libc.h (relax_fenv_state): Add 'volatile'.
a2cf7d
            * sysdeps/powerpc/fpu/fpu_control.h (__FPU_MFFS): Likewise.
a2cf7d
            (__FPU_MFFSL): Likewise.
a2cf7d
            (_FPU_SETCW): Likewise.
a2cf7d
a2cf7d
diff --git a/sysdeps/powerpc/fpu/fenv_libc.h b/sysdeps/powerpc/fpu/fenv_libc.h
a2cf7d
index a0128c66444a3e46..d6945903b525748e 100644
a2cf7d
--- a/sysdeps/powerpc/fpu/fenv_libc.h
a2cf7d
+++ b/sysdeps/powerpc/fpu/fenv_libc.h
a2cf7d
@@ -57,9 +57,9 @@ extern const fenv_t *__fe_mask_env (void) attribute_hidden;
a2cf7d
 #define relax_fenv_state() \
a2cf7d
 	do { \
a2cf7d
 	   if (GLRO(dl_hwcap) & PPC_FEATURE_HAS_DFP) \
a2cf7d
-	     asm (".machine push; .machine \"power6\"; " \
a2cf7d
+	     asm volatile (".machine push; .machine \"power6\"; " \
a2cf7d
 		  "mtfsfi 7,0,1; .machine pop"); \
a2cf7d
-	   asm ("mtfsfi 7,0"); \
a2cf7d
+	   asm volatile ("mtfsfi 7,0"); \
a2cf7d
 	} while(0)
a2cf7d
 
a2cf7d
 /* Set/clear a particular FPSCR bit (for instance,
a2cf7d
diff --git a/sysdeps/powerpc/fpu_control.h b/sysdeps/powerpc/fpu_control.h
a2cf7d
index 62c478d72ae660cb..90063d77bbbf794f 100644
a2cf7d
--- a/sysdeps/powerpc/fpu_control.h
a2cf7d
+++ b/sysdeps/powerpc/fpu_control.h
a2cf7d
@@ -98,7 +98,7 @@ typedef unsigned int fpu_control_t;
a2cf7d
 /* Macros for accessing the hardware control word.  */
a2cf7d
 # define __FPU_MFFS()						\
a2cf7d
   ({register double __fr;					\
a2cf7d
-    __asm__ ("mffs %0" : "=f" (__fr));				\
a2cf7d
+    __asm__ __volatile__("mffs %0" : "=f" (__fr));		\
a2cf7d
     __fr;							\
a2cf7d
   })
a2cf7d
 
a2cf7d
@@ -112,7 +112,7 @@ typedef unsigned int fpu_control_t;
a2cf7d
 #ifdef _ARCH_PWR9
a2cf7d
 # define __FPU_MFFSL()						\
a2cf7d
   ({register double __fr;					\
a2cf7d
-    __asm__ ("mffsl %0" : "=f" (__fr));				\
a2cf7d
+    __asm__ __volatile__("mffsl %0" : "=f" (__fr));		\
a2cf7d
     __fr;							\
a2cf7d
   })
a2cf7d
 #else
a2cf7d
@@ -132,7 +132,7 @@ typedef unsigned int fpu_control_t;
a2cf7d
     __u.__ll = 0xfff80000LL << 32; /* This is a QNaN.  */	\
a2cf7d
     __u.__ll |= (cw) & 0xffffffffLL;				\
a2cf7d
     __fr = __u.__d;						\
a2cf7d
-    __asm__ ("mtfsf 255,%0" : : "f" (__fr));			\
a2cf7d
+    __asm__ __volatile__("mtfsf 255,%0" : : "f" (__fr));	\
a2cf7d
   }
a2cf7d
 
a2cf7d
 /* Default control word set at startup.  */