[llvm-bugs] [Bug 30728] New: Cannot build with -DLIBOMP_OMP_VERSION=40

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 18 14:12:13 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30728

            Bug ID: 30728
           Summary: Cannot build with -DLIBOMP_OMP_VERSION=40
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Runtime Library
          Assignee: unassignedbugs at nondot.org
          Reporter: pawel.osmialowski at foss.arm.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

When building with -DLIBOMP_OMP_VERSION=40 compiler complains that
th_steal_lock and proxy fields are not defined.

A short workaround patch can make this code buildable with
-DLIBOMP_OMP_VERSION=40:

diff --git a/runtime/src/kmp.h b/runtime/src/kmp.h
index eff3c93..18d72a3 100644
--- a/runtime/src/kmp.h
+++ b/runtime/src/kmp.h
@@ -1738,16 +1738,16 @@ typedef struct kmp_disp {

     dispatch_private_info_t *th_disp_buffer;
     kmp_int32                th_disp_index;
-#if OMP_45_ENABLED
+// #if OMP_45_ENABLED
     kmp_int32                th_doacross_buf_idx; // thread's doacross buffer
index
     volatile kmp_uint32     *th_doacross_flags;   // pointer to shared array
of flags
     union { // we can use union here because doacross cannot be used in
nonmonotonic loops
         kmp_int64           *th_doacross_info;    // info on loop bounds
         kmp_lock_t          *th_steal_lock;       // lock used for chunk
stealing (8-byte variable)
diff --git a/runtime/src/kmp_tasking.c b/runtime/src/kmp_tasking.c
index 0c806c2..089620b 100644
--- a/runtime/src/kmp_tasking.c
+++ b/runtime/src/kmp_tasking.c
@@ -578,7 +578,11 @@ __kmp_free_task_and_ancestors( kmp_int32 gtid,
kmp_taskdata_t * taskdata, kmp_in
 {
     // Proxy tasks must always be allowed to free their parents
     // because they can be run in background even in serial mode.
+#if OMP_45_ENABLED
     kmp_int32 task_serial = taskdata->td_flags.task_serial &&
!taskdata->td_flags.proxy;
+#else
+    kmp_int32 task_serial = taskdata->td_flags.task_serial;
+#endif
     KMP_DEBUG_ASSERT( taskdata -> td_flags.tasktype == TASK_EXPLICIT );

     kmp_int32 children = KMP_TEST_THEN_DEC32( (kmp_int32 *)(& taskdata ->
td_allocated_child_tasks) ) - 1;

     };
-#else
-    void* dummy_padding[2]; // make it 64 bytes on Intel(R) 64
-#endif
+// #else
+//    void* dummy_padding[2]; // make it 64 bytes on Intel(R) 64
+// #endif
 #if KMP_USE_INTERNODE_ALIGNMENT
     char more_padding[INTERNODE_CACHE_LINE];
 #endif

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161018/66b1e8bf/attachment.html>


More information about the llvm-bugs mailing list