gcc-4.8 does not supported std::atomic for 128-bit types
authorkhizmax <libcds.dev@gmail.com>
Mon, 19 Sep 2016 19:09:45 +0000 (22:09 +0300)
committerkhizmax <libcds.dev@gmail.com>
Mon, 19 Sep 2016 19:09:45 +0000 (22:09 +0300)
cds/compiler/gcc/defs.h
test/stress/freelist/put_get.cpp
test/stress/freelist/put_get_single.cpp

index e2c3b76..99d8589 100644 (file)
 
 // double-width CAS support
 #if CDS_BUILD_BITS == 64
-#   ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
+    // gcc-4.8 does not support 16-word (128bit) atomics
+#   if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 ) && CDS_COMPILER_VERSION >= 40900
 #       define CDS_DCAS_SUPPORT
 #   endif
 #else
index 0859361..15173a9 100644 (file)
@@ -164,6 +164,7 @@ namespace {
     typedef cds::intrusive::CachedFreeList<cds::intrusive::FreeList> cached_free_list;
     CDSSTRESS_FREELIST_F( CachedFreeList, cached_free_list )
 
+#ifdef CDS_DCAS_SUPPORT
     TEST_F( put_get, TaggetFreeList )
     {
         struct tagged_ptr {
@@ -179,5 +180,6 @@ namespace {
         else
             std::cout << "Double-width CAS is not supported\n";
     }
+#endif
 
 } // namespace
index c7d3335..7775378 100644 (file)
@@ -144,6 +144,7 @@ namespace {
     typedef cds::intrusive::CachedFreeList<cds::intrusive::FreeList> cached_free_list;
     CDSSTRESS_FREELIST_F( CachedFreeList, cached_free_list )
 
+#ifdef CDS_DCAS_SUPPORT
     TEST_F( put_get_single, TaggetFreeList )
     {
         struct tagged_ptr {
@@ -159,5 +160,6 @@ namespace {
         else
             std::cout << "Double-width CAS is not supported\n";
     }
+#endif
 
 } // namespace