Add "()" when casting to uint64_t for 64-bit store
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 24 Sep 2012 16:11:12 +0000 (09:11 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 24 Sep 2012 16:11:12 +0000 (09:11 -0700)
nptl/ChangeLog
nptl/sysdeps/x86_64/tls.h

index ebb9048..f2fded0 100644 (file)
@@ -1,3 +1,9 @@
+2012-09-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * sysdeps/x86_64/tls.h (THREAD_SETMEM): Add "()" when casting
+       to uint64_t for 64-bit store.
+       (THREAD_SETMEM_NC): Likewise.
+
 2012-09-19  H.J. Lu  <hongjiu.lu@intel.com>
 
        * sysdeps/i386/tls.h (THREAD_SETMEM): Cast to uint64_t for
index f838916..b651d1c 100644 (file)
@@ -256,7 +256,7 @@ typedef struct
           abort ();                                                          \
                                                                              \
         asm volatile ("movq %q0,%%fs:%P1" :                                  \
-                      : IMM_MODE ((uint64_t) value),                         \
+                      : IMM_MODE ((uint64_t) (value)),                       \
                         "i" (offsetof (struct pthread, member)));            \
        }})
 
@@ -281,7 +281,7 @@ typedef struct
           abort ();                                                          \
                                                                              \
         asm volatile ("movq %q0,%%fs:%P1(,%q2,8)" :                          \
-                      : IMM_MODE ((uint64_t) value),                         \
+                      : IMM_MODE ((uint64_t) (value)),                       \
                         "i" (offsetof (struct pthread, member[0])),          \
                         "r" (idx));                                          \
        }})