[Openmp-commits] [PATCH] D86324: [libomptarget][nfc] Drop __kmpc_data_sharing_slot flexible array member

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Aug 20 18:08:19 PDT 2020


JonChesterfield created this revision.
JonChesterfield added reviewers: jdoerfert, grokos, ABataev.
Herald added subscribers: openmp-commits, aaron.ballman.
Herald added a project: OpenMP.
JonChesterfield requested review of this revision.
Herald added a subscriber: sstefan1.

[libomptarget][nfc] Drop __kmpc_data_sharing_slot flexible array member

The C99 flexible array member is accepted as an extension in cuda/hip. Accessing
the data[] member of a __kmpc_data_sharing_worker_slot_static through a pointer
to __kmpc_data_sharing_slot.data[] is also an aliasing violation. Casting the
pointer to the first member is well defined for a standard layout type.

This change is non-functional in practice as the compiler does the right thing
with the aliasing violation and supports the flexible array member from C99.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86324

Files:
  openmp/libomptarget/deviceRTLs/common/omptarget.h
  openmp/libomptarget/deviceRTLs/common/src/data_sharing.cu
  openmp/libomptarget/deviceRTLs/common/src/omptarget.cu
  openmp/libomptarget/deviceRTLs/interface.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86324.286930.patch
Type: text/x-patch
Size: 7562 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20200821/aa15785b/attachment.bin>


More information about the Openmp-commits mailing list