[llvm-bugs] [Bug 30581] New: Inconsistent value of ATOMIC_LLONG_LOCK_FREE vs __atomic_always_lock_free(sizeof(long long), 0) on 32-bit x86
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Sep 30 11:24:35 PDT 2016
https://llvm.org/bugs/show_bug.cgi?id=30581
Bug ID: 30581
Summary: Inconsistent value of ATOMIC_LLONG_LOCK_FREE vs
__atomic_always_lock_free(sizeof(long long), 0) on
32-bit x86
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: mgorny at gentoo.org
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
Consider the following test program:
#include <iostream>
int main()
{
// for comparison
std::cerr << __GCC_ATOMIC_LONG_LOCK_FREE << std::endl;
std::cerr << __atomic_always_lock_free(sizeof(long), 0) << std::endl;
std::cerr << __GCC_ATOMIC_LLONG_LOCK_FREE << std::endl;
std::cerr << __atomic_always_lock_free(sizeof(long long), 0) << std::endl;
return 0;
}
$ clang++ -m32 test.cxx
$ ./a.out
2
1
1
1
So, ATOMIC_LLONG_LOCK_FREE indicates that the time is *sometimes* lock-free yet
__atomic_always_lock_free() indicates it's *always* lock-free.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160930/767e8aed/attachment.html>
More information about the llvm-bugs
mailing list