--- old/src/os_cpu/linux_x86/vm/atomic_linux_x86.hpp 2017-08-16 01:47:24.977232759 -0400 +++ new/src/os_cpu/linux_x86/vm/atomic_linux_x86.hpp 2017-08-16 01:47:24.869227210 -0400 @@ -85,6 +85,7 @@ T volatile* dest, T compare_value, cmpxchg_memory_order /* order */) const { + STATIC_ASSERT(1 == sizeof(T)); __asm__ volatile ("lock cmpxchgb %1,(%3)" : "=a" (exchange_value) : "q" (exchange_value), "a" (compare_value), "r" (dest) @@ -98,6 +99,7 @@ T volatile* dest, T compare_value, cmpxchg_memory_order /* order */) const { + STATIC_ASSERT(4 == sizeof(T)); __asm__ volatile ("lock cmpxchgl %1,(%3)" : "=a" (exchange_value) : "r" (exchange_value), "a" (compare_value), "r" (dest) @@ -150,6 +152,7 @@ T volatile* dest, T compare_value, cmpxchg_memory_order /* order */) const { + STATIC_ASSERT(8 == sizeof(T)); __asm__ __volatile__ ("lock cmpxchgq %1,(%3)" : "=a" (exchange_value) : "r" (exchange_value), "a" (compare_value), "r" (dest) @@ -194,7 +197,8 @@ T volatile* dest, T compare_value, cmpxchg_memory_order order) const { - return cmpxchg_using_stub(_Atomic_cmpxchg_long, exchange_value, dest, compare_value); + STATIC_ASSERT(8 == sizeof(T)); + return cmpxchg_using_helper(_Atomic_cmpxchg_long, exchange_value, dest, compare_value); } inline jlong Atomic::load(const volatile jlong* src) {