From: SF/projects/mingw n. l. <min...@li...> - 2011-10-07 15:46:26
|
Bugs item #3420359, was opened at 2011-10-07 15:46 Message generated for change (Tracker Item Submitted) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3420359&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: antran () Assigned to: Nobody/Anonymous (nobody) Summary: Missing atomic builtins Initial Comment: Given the same OS (Windows) and the same arch (X86), it's quite weird that MinGW-W64 GCC or Cygwin GCC does have support for atomic builtins but MinGW GCC doesnt. For more details, please see c++config.h for _GLIBCXX_ATOMIC_BUILTINS* macro definitions. Test case: #include <stdint.h> struct AtomicBuiltins { template <class T> static void check() { T value = 0; __sync_fetch_and_add(&value, 0); __sync_fetch_and_sub(&value, 0); __sync_fetch_and_or(&value, 0); __sync_fetch_and_and(&value, 0); __sync_fetch_and_xor(&value, 0); __sync_fetch_and_nand(&value, 0); __sync_add_and_fetch(&value, 0); __sync_sub_and_fetch(&value, 0); __sync_or_and_fetch(&value, 0); __sync_and_and_fetch(&value, 0); __sync_xor_and_fetch(&value, 0); __sync_nand_and_fetch(&value, 0); __sync_bool_compare_and_swap(&value, 0, 1); __sync_val_compare_and_swap(&value, 1, 2); __sync_lock_test_and_set(&value, 1); __sync_lock_release(&value); __sync_synchronize(); } }; int main() { AtomicBuiltins::check<int8_t>(); AtomicBuiltins::check<int16_t>(); AtomicBuiltins::check<int32_t>(); AtomicBuiltins::check<int64_t>(); return 0; } Please note that atomic builtins are required for stuffs like std::exception_ptr or std::atomic. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3420359&group_id=2435 |