[clang] 2d18a86 - [X86] Fix uninitialized variable warnings in cetintrin.h reported by #55224

Phoebe Wang via cfe-commits cfe-commits at lists.llvm.org
Wed May 4 06:12:22 PDT 2022


Author: Phoebe Wang
Date: 2022-05-04T21:12:12+08:00
New Revision: 2d18a86d14a936798a34b10d4b951465b7f0527f

URL: https://github.com/llvm/llvm-project/commit/2d18a86d14a936798a34b10d4b951465b7f0527f
DIFF: https://github.com/llvm/llvm-project/commit/2d18a86d14a936798a34b10d4b951465b7f0527f.diff

LOG: [X86] Fix uninitialized variable warnings in cetintrin.h reported by #55224

Fix uninitialized variables introduced by D116325.

Differential Revision: https://reviews.llvm.org/D124916

Added: 
    

Modified: 
    clang/lib/Headers/cetintrin.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/Headers/cetintrin.h b/clang/lib/Headers/cetintrin.h
index 019cab0261e7f..55670a0a9dba6 100644
--- a/clang/lib/Headers/cetintrin.h
+++ b/clang/lib/Headers/cetintrin.h
@@ -43,8 +43,11 @@ static __inline__ unsigned int __DEFAULT_FN_ATTRS _rdsspd(unsigned int __a) {
 }
 
 static __inline__ unsigned int __DEFAULT_FN_ATTRS _rdsspd_i32() {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wuninitialized"
   unsigned int t;
   return __builtin_ia32_rdsspd(t);
+#pragma clang diagnostic pop
 }
 
 #ifdef __x86_64__
@@ -53,8 +56,11 @@ static __inline__ unsigned long long __DEFAULT_FN_ATTRS _rdsspq(unsigned long lo
 }
 
 static __inline__ unsigned long long __DEFAULT_FN_ATTRS _rdsspq_i64() {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wuninitialized"
   unsigned long long t;
   return __builtin_ia32_rdsspq(t);
+#pragma clang diagnostic pop
 }
 #endif /* __x86_64__ */
 


        


More information about the cfe-commits mailing list