[C11-atomic] new test: limit precomputing values across acquire barriers

Aldy Hernandez aldyh@redhat.com
Fri Mar 23 15:47:00 GMT 2012


This is a similar test to the previous acquire test.  Here we are 
incorrectly caching 'x' and failing to reload it after the __ATOMIC_ACQUIRE.

+  i = x + y;
+
+  if (__atomic_load_n (&flag, __ATOMIC_ACQUIRE))
+    {
+      /* x here should not be reused from above.  */
+      k = x;
+    }

Note that there is technically a data race on the load of x+y.  See the 
explanation on my previous testcase.

OK for branch?
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: curr
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120323/5dc02507/attachment.ksh>


More information about the Gcc-patches mailing list