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 e2c3b7640def756af1430da78358e57145bc94fa..99d8589c17d33f9c54e24f43196527ccf5e54efa 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 08593617abee4575525c7a63df95105d42df5e88..15173a9b7daa5c8e6815a3e1525fb8235361f11a 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 c7d3335868f8e08b212c74fc9fd0762ecbdf6fcf..7775378ee2d55f89c536a534eea0fb5d54f93fa2 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