[Openmp-commits] [PATCH] D137748: [openmp] [test] Fix data structure mismatches for tests that define kmp_depend_info

Martin Storsjö via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Nov 9 14:28:12 PST 2022


mstorsjo created this revision.
mstorsjo added reviewers: AndreyChurbanov, JonChesterfield, natgla.
Herald added subscribers: guansong, yaxunl.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.
Herald added a project: OpenMP.

Use the correct data type for pointer sized integers on Windows;
"long" is always 32 bit, even on 64 bit Windows - don't use it
for the kmp_intptr_t type.

Provide the exact correct definition of the kmp_depend_info
struct - avoid the risk of mismatches (if a platform would pack
things slightly differently when things are declared differently).

Zero initialize the whole dep_info struct before filling it in;
if only setting the in/out bits, the rest of the unallocated bits
in the bitfield can have undefined values. Libomp reads the flags
in combined form as an kmp_uint8 by reading the flag field - thus,
the unused bits do need to be zeroed. (Alternatively, the flag field
could be set to zero before setting the individual bits in the
bitfield).

Use kmp_intptr_t instead of long for casting pointers to integers.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137748

Files:
  openmp/runtime/test/tasking/bug_nested_proxy_task.c
  openmp/runtime/test/tasking/bug_proxy_task_dep_waiting.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137748.474368.patch
Type: text/x-patch
Size: 2860 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20221109/66fcead8/attachment.bin>


More information about the Openmp-commits mailing list