[Openmp-commits] [PATCH] D65868: [OpenMP] Remove workaround for CMPXCHG

Jonas Hahnfeld via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Aug 15 07:07:39 PDT 2019


Hahnfeld added a comment.

In D65868#1625642 <https://reviews.llvm.org/D65868#1625642>, @jlpeyton wrote:

> Unfortunately, the Windows atomic code will not compile with this change.  See in kmp_atomic.h the different atomic types for Windows.  The complaints are regarding assignment operations for the complex types.
>
>   ../../src/kmp_atomic.cpp(1325): error: class "__kmp_cmplx32_t" has no suitable assignment operator
>     ATOMIC_CMPXCHG(cmplx4, add, kmp_cmplx32, 64, +, 8c, 7,
>     ^
>


Oh wow, that code is ugly, and GCC loudly complains that a C function returns a C++ `struct`. Is it still true that "Intel compiler does not support _Complex datatype on win." or could we possibly get rid of `__kmp_cmplx64_t` and `__kmp_cmplx32_t`?

The problem is that `OP_CMPXCHG` casts `lhs` of type `TYPE *` to `TYPE volatile *`. This works for primitive data types, but not for structs because it can't use the implemented assignment operator.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65868/new/

https://reviews.llvm.org/D65868





More information about the Openmp-commits mailing list