[PATCH] D69062: Resolve LWG issue 2426

Zoe Carver via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 16 11:33:37 PDT 2019


zoecarver created this revision.
zoecarver added reviewers: mclow.lists, EricWF, ldionne, rsmith.
Herald added subscribers: libcxx-commits, cfe-commits, dexonsmith, christof.
Herald added projects: clang, libc++.

This patch checks that `expected` is loaded before it is used. Libc++ already does this.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69062

Files:
  clang/test/CodeGen/atomic-ops.c
  libcxx/www/cxx1z_status.html


Index: libcxx/www/cxx1z_status.html
===================================================================
--- libcxx/www/cxx1z_status.html
+++ libcxx/www/cxx1z_status.html
@@ -318,7 +318,7 @@
 	<tr><td><a href="https://wg21.link/LWG2328">2328</a></td><td>Rvalue stream extraction should use perfect forwarding</td><td>Oulu</td><td>Complete</td></tr>
 	<tr><td><a href="https://wg21.link/LWG2393">2393</a></td><td>std::function's Callable definition is broken</td><td>Oulu</td><td>Complete</td></tr>
 	<tr><td><a href="https://wg21.link/LWG2422">2422</a></td><td>std::numeric_limits<T>::is_modulo description: "most machines" errata</td><td>Oulu</td><td>Complete</td></tr>
-	<tr><td><a href="https://wg21.link/LWG2426">2426</a></td><td>Issue about compare_exchange</td><td>Oulu</td><td></td></tr>
+	<tr><td><a href="https://wg21.link/LWG2426">2426</a></td><td>Issue about compare_exchange</td><td>Oulu</td><td>Complete</td></tr>
 	<tr><td><a href="https://wg21.link/LWG2436">2436</a></td><td>Comparators for associative containers should always be CopyConstructible</td><td>Oulu</td><td>Complete</td></tr>
 	<tr><td><a href="https://wg21.link/LWG2441">2441</a></td><td>Exact-width atomic typedefs should be provided</td><td>Oulu</td><td>Complete</td></tr>
 	<tr><td><a href="https://wg21.link/LWG2451">2451</a></td><td>[fund.ts.v2] optional should 'forward' T's implicit conversions</td><td>Oulu</td><td>Nothing to do</td></tr>
Index: clang/test/CodeGen/atomic-ops.c
===================================================================
--- clang/test/CodeGen/atomic-ops.c
+++ clang/test/CodeGen/atomic-ops.c
@@ -466,6 +466,8 @@
   // CHECK: cmpxchg i32* {{%[0-9A-Za-z._]+}}, i32 {{%[0-9A-Za-z._]+}}, i32 {{%[0-9A-Za-z_.]+}} acquire monotonic
 
   __c11_atomic_compare_exchange_weak(ptr, ptr2, 43, memory_order_seq_cst, memory_order_acquire);
+  // CHECK: load i32, i32* {{%[0-9A-Za-z._]+}}, align 4
+  // CHECK: load i32, i32* {{%[0-9A-Za-z._]+}}, align 4
   // CHECK: cmpxchg weak i32* {{%[0-9A-Za-z._]+}}, i32 {{%[0-9A-Za-z._]+}}, i32 {{%[0-9A-Za-z_.]+}} seq_cst acquire
 
   // Unknown ordering: conservatively pick strongest valid option (for now!).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69062.225277.patch
Type: text/x-patch
Size: 2156 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191016/f69a0573/attachment.bin>


More information about the cfe-commits mailing list