r295082 - Fix some warnings in intrin.h

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 14 10:38:19 PST 2017


Author: rnk
Date: Tue Feb 14 12:38:19 2017
New Revision: 295082

URL: http://llvm.org/viewvc/llvm-project?rev=295082&view=rev
Log:
Fix some warnings in intrin.h

Modified:
    cfe/trunk/lib/Headers/intrin.h

Modified: cfe/trunk/lib/Headers/intrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/intrin.h?rev=295082&r1=295081&r2=295082&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/intrin.h (original)
+++ cfe/trunk/lib/Headers/intrin.h Tue Feb 14 12:38:19 2017
@@ -897,19 +897,21 @@ __readfsqword(unsigned long __offset) {
 #ifdef __x86_64__
 static __inline__ unsigned char __DEFAULT_FN_ATTRS
 __readgsbyte(unsigned long __offset) {
-  return *__ptr_to_addr_space(256, unsigned char, __offset);
+  return *__ptr_to_addr_space(256, unsigned char, (unsigned long long)__offset);
 }
 static __inline__ unsigned short __DEFAULT_FN_ATTRS
 __readgsword(unsigned long __offset) {
-  return *__ptr_to_addr_space(256, unsigned short, __offset);
+  return *__ptr_to_addr_space(256, unsigned short,
+                              (unsigned long long)__offset);
 }
 static __inline__ unsigned long __DEFAULT_FN_ATTRS
 __readgsdword(unsigned long __offset) {
-  return *__ptr_to_addr_space(256, unsigned long, __offset);
+  return *__ptr_to_addr_space(256, unsigned long, (unsigned long long)__offset);
 }
 static __inline__ unsigned __int64 __DEFAULT_FN_ATTRS
 __readgsqword(unsigned long __offset) {
-  return *__ptr_to_addr_space(256, unsigned __int64, __offset);
+  return *__ptr_to_addr_space(256, unsigned __int64,
+                              (unsigned long long)__offset);
 }
 #endif
 #undef __ptr_to_addr_space




More information about the cfe-commits mailing list