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