Hi David,<div><br></div><div>Clang now crashes in the libc++ atomics tests. Cutdown testcase:</div><div><br></div><div>_Atomic(bool) b = true;<br><br>I suspect there's an i1 / i8 confusion somewhere.<br><br><div class="gmail_quote">
On Wed, Apr 11, 2012 at 10:26 AM, David Chisnall <span dir="ltr"><<a href="mailto:csdavec@swan.ac.uk">csdavec@swan.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: theraven<br>
Date: Wed Apr 11 12:26:23 2012<br>
New Revision: 154508<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=154508&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=154508&view=rev</a><br>
Log:<br>
Now that clang supports doing the right thing with regard to atomic<br>
initialisation, do the right thing with regard to atomic initialisation.<br>
<br>
Note: clang r154507 or later required for <atomic> to work now.<br>
<br>
<br>
Modified:<br>
    libcxx/trunk/include/atomic<br>
<br>
Modified: libcxx/trunk/include/atomic<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/atomic?rev=154508&r1=154507&r2=154508&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/atomic?rev=154508&r1=154507&r2=154508&view=diff</a><br>

==============================================================================<br>
--- libcxx/trunk/include/atomic (original)<br>
+++ libcxx/trunk/include/atomic Wed Apr 11 12:26:23 2012<br>
@@ -621,7 +621,7 @@<br>
     _LIBCPP_INLINE_VISIBILITY<br>
     __atomic_base() {} // = default;<br>
     _LIBCPP_INLINE_VISIBILITY<br>
-    /*constexpr*/ __atomic_base(_Tp __d) { __atomic_store(&__a_, __d, memory_order_seq_cst); }<br>
+    /*constexpr*/ __atomic_base(_Tp __d) : __a_(__d) {}<br>
 #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS<br>
     __atomic_base(const __atomic_base&) = delete;<br>
     __atomic_base& operator=(const __atomic_base&) = delete;<br>
@@ -820,7 +820,7 @@<br>
 void<br>
 atomic_init(volatile atomic<_Tp>* __o, _Tp __d)<br>
 {<br>
-    __atomic_store(&__o->__a_, __d, memory_order_seq_cst);<br>
+    __atomic_init(&__o->__a_, __d);<br>
 }<br>
<br>
 template <class _Tp><br>
@@ -828,7 +828,7 @@<br>
 void<br>
 atomic_init(atomic<_Tp>* __o, _Tp __d)<br>
 {<br>
-    __atomic_store(&__o->__a_, __d, memory_order_seq_cst);<br>
+    __atomic_init(&__o->__a_, __d);<br>
 }<br>
<br>
 // atomic_store<br>
@@ -1366,7 +1366,7 @@<br>
     _LIBCPP_INLINE_VISIBILITY<br>
     atomic_flag() {} // = default;<br>
     _LIBCPP_INLINE_VISIBILITY<br>
-    atomic_flag(bool __b) { __atomic_store(&__a_, __b, memory_order_seq_cst); }<br>
+    atomic_flag(bool __b) : __a_(__b) {}<br>
<br>
 #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS<br>
     atomic_flag(const atomic_flag&) = delete;<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>