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