[Openmp-commits] [PATCH] D40753: Fix PR30890: Reduction across teams hangs
Jonas Hahnfeld via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Tue Dec 5 10:50:40 PST 2017
Hahnfeld added inline comments.
================
Comment at: openmp/trunk/runtime/test/misc_bugs/teams-reduction.c:33-34
+
+typedef int32_t kmp_critical_name[8];
+kmp_critical_name crit;
+
----------------
The compiler only aligns this to 4 byte, the size of one `int32_t`. This results in a SIGBUS error on Power because the runtime stores a pointer so the memory location needs to be aligned to 8 bytes. I've solved this in rL319811 with
```lang=c
typedef union {
// The global will be used as pointer, so we need to make sure that the
// compiler correctly aligns the global...
void *ptr;
int32_t data[8];
} kmp_critical_name;
```
If somebody has a less ugly idea, I'm happy to listen but I didn't want to use compiler dependent alignment directives...
Repository:
rL LLVM
https://reviews.llvm.org/D40753
More information about the Openmp-commits
mailing list