Subject: [Boost-bugs] [Boost C++ Libraries] #9842: long long not lockfree on i686 compiled with clang
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-04-06 21:14:37
#9842: long long not lockfree on i686 compiled with clang
-------------------------------------+--------------------------
Reporter: gjasny@⦠| Owner: timblechmann
Type: Bugs | Status: new
Milestone: To Be Determined | Component: atomic
Version: Boost Development Trunk | Severity: Problem
Keywords: |
-------------------------------------+--------------------------
$ clang --version
Hello,
I just discovered that the lockfree test fails on trunk:
====== BEGIN OUTPUT ======
atomic<char> is always lock free
atomic<short> is always lock free
atomic<int> is always lock free
atomic<long> is always lock free
lockfree.cpp(29): test lock_free_macro_val == lock_free_expect failed in
function: 'void verify_lock_free(const char *, int, int) [T = long long]'
atomic<long long> is never lock free
atomic<void *> is always lock free
atomic<bool> is always lock free
My system is a Mac with 10.9 and Xcode 5.1:
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
I build the three with:
b2 toolset=darwin architecture=x86 address-model=32
I think t boils down to the following:
$ clang -march=core2 -dM -E - -m32 < /dev/null|grep -i
__GCC_ATOMIC_LLONG_LOCK_FREE
#define __GCC_ATOMIC_LLONG_LOCK_FREE 1
The lockfree test expects 2 here.
(Clang 3.4 on Linux also just returns 1 for long long).
If I change the code in the platform header and switch from gcc-atomic.hpp
to gcc-x86.hpp the test passes.
Thanks,
Gregor
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9842> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:15 UTC