[Openmp-commits] [openmp] af6511d - [OpenMP] Fixed Bug 49356

Shilei Tian via Openmp-commits openmp-commits at lists.llvm.org
Mon May 17 09:15:00 PDT 2021


Author: Shilei Tian
Date: 2021-05-17T12:14:54-04:00
New Revision: af6511d730f18beb9053c0120c45abef031344e9

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

LOG: [OpenMP] Fixed Bug 49356

Bug 49356 (https://bugs.llvm.org/show_bug.cgi?id=49356) reports crash in
the test case `tasking/bug_taskwait_detach.cpp`, which is caused by the wrong
function declaration. `gtid` in `__kmpc_omp_task` should be `kmp_int32`.

Reviewed By: AndreyChurbanov

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

Added: 
    

Modified: 
    openmp/runtime/test/tasking/bug_taskwait_detach.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/test/tasking/bug_taskwait_detach.cpp b/openmp/runtime/test/tasking/bug_taskwait_detach.cpp
index cadfe9b3a297f..7a0ced73e3343 100644
--- a/openmp/runtime/test/tasking/bug_taskwait_detach.cpp
+++ b/openmp/runtime/test/tasking/bug_taskwait_detach.cpp
@@ -3,6 +3,7 @@
 #include <omp.h>
 
 #include <chrono>
+#include <cstdint>
 #include <iostream>
 #include <thread>
 
@@ -10,7 +11,7 @@
 #define PTASK_FLAG_DETACHABLE 0x40
 
 // OpenMP RTL interfaces
-typedef long long kmp_int64;
+using kmp_int32 = int32_t;
 
 typedef struct ID {
   int reserved_1;
@@ -59,7 +60,8 @@ extern "C" {
 extern int __kmpc_global_thread_num(void *id_ref);
 extern int **__kmpc_omp_task_alloc(id *loc, int gtid, int flags, size_t sz,
                                    size_t shar, task_entry_t rtn);
-extern int __kmpc_omp_task(id *loc, kmp_int64 gtid, kmp_task_t *task);
+extern kmp_int32 __kmpc_omp_task(ident_t *loc_ref, kmp_int32 gtid,
+                                 kmp_task_t *new_task);
 extern omp_event_handle_t __kmpc_task_allow_completion_event(ident_t *loc_ref,
                                                              int gtid,
                                                              kmp_task_t *task);


        


More information about the Openmp-commits mailing list