[Openmp-commits] [PATCH] D95486: [libomptarget][NFC] Avoid gcc 5/6 issue with lambda captures.

Vyacheslav Zakharin via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jan 26 15:05:46 PST 2021


vzakhari created this revision.
vzakhari added reviewers: grokos, jhuber6.
vzakhari requested review of this revision.
Herald added a project: OpenMP.
Herald added a subscriber: openmp-commits.

See discussion in https://reviews.llvm.org/D93727#inline-893326


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95486

Files:
  openmp/libomptarget/include/Debug.h


Index: openmp/libomptarget/include/Debug.h
===================================================================
--- openmp/libomptarget/include/Debug.h
+++ openmp/libomptarget/include/Debug.h
@@ -53,7 +53,8 @@
   OMP_INFOTYPE_ALL = 0xffffffff,
 };
 
-static inline uint32_t getInfoLevel() {
+// Add __attribute__((used)) to work around a bug in gcc 5/6.
+static inline uint32_t __attribute__((used)) getInfoLevel() {
   static uint32_t InfoLevel = 0;
   static std::once_flag Flag{};
   std::call_once(Flag, []() {
@@ -64,7 +65,8 @@
   return InfoLevel;
 }
 
-static inline uint32_t getDebugLevel() {
+// Add __attribute__((used)) to work around a bug in gcc 5/6.
+static inline uint32_t __attribute__((used)) getDebugLevel() {
   static uint32_t DebugLevel = 0;
   static std::once_flag Flag{};
   std::call_once(Flag, []() {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95486.319418.patch
Type: text/x-patch
Size: 826 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210126/eba937dd/attachment-0001.bin>


More information about the Openmp-commits mailing list