ensure the compiler does not move around thread-register-based reads
[musl] / arch / x86_64 / pthread_arch.h
index c424493..836187f 100644 (file)
@@ -1,7 +1,7 @@
 static inline struct pthread *__pthread_self()
 {
        struct pthread *self;
-       __asm__ ("movq %%fs:0,%0" : "=r" (self) );
+       __asm__ __volatile__ ("movq %%fs:0,%0" : "=r" (self) );
        return self;
 }