[LLVMbugs] [Bug 22514] Wrong transformation due to semantic gap between C11 and LLVM semantics

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Feb 9 11:01:38 PST 2015


http://llvm.org/bugs/show_bug.cgi?id=22514

soham <sohachak at mpi-sws.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #2 from soham <sohachak at mpi-sws.org> ---
In the source program 

x = 1 => x.store(1,std::memory_order_seq_cst) and
x == 1 => x.load(std::memory_order_seq_cst) == 1

The R_sc(X,1) in readA() reads-from W_sc(X,1) in writeA() which results in
synchronization and W_na(a,42) happens-before R_na(a,42) and thus synchronized. 
If (x==1) test fails then W(x) and R(x) is not synchronized and in that case
R_na(a) does not take place.

Thus the source program is race 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/20150209/f786da6d/attachment.html>


More information about the llvm-bugs mailing list