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

Phoebe Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 4 20:05:16 PDT 2022


pengfei marked an inline comment as done.
pengfei added inline comments.


================
Comment at: clang/lib/Headers/cetintrin.h:45
 
 static __inline__ unsigned int __DEFAULT_FN_ATTRS _rdsspd_i32() {
+#pragma clang diagnostic push
----------------
craig.topper wrote:
> The argument should also be `(void)`.
Thanks! Done by rGaa25b55bde87.


================
Comment at: clang/lib/Headers/cetintrin.h:48
+#pragma clang diagnostic ignored "-Wuninitialized"
   unsigned int t;
   return __builtin_ia32_rdsspd(t);
----------------
craig.topper wrote:
> So if CET isn't enabled this intrinsic returns a random value instead of 0 like _get_ssp?
Exactly! These intrinsics are used to reflect the exact instructions behavior, i.e., a nop operation. They are used for performance.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124916/new/

https://reviews.llvm.org/D124916



More information about the cfe-commits mailing list