<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 17, 2016 at 1:23 PM, Dmitry Vyukov <span dir="ltr"><<a href="mailto:dvyukov@google.com" target="_blank">dvyukov@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dvyukov added a comment.<br>
<span class=""><br>
> Sorry it may seem obvious to you, but here is the puzzle: suppose the two cases I mentioned produces *identical* code in the final binary -- it either has race or not, but not both.  HoweverTsan says it has race if produced from one form of IR while no race from another?<br>
<br>
<br>
</span>Consider that we have two programs: one overflows int, another overflows unsigned. Both programs can potentially produce the same machine code and the same result. But the first one still contains a bug that leads to undefined behavior of the program. While the second does not.<br>
The same situations happens with atomic and plain memory accesses. The fact that you get correct machine code on a particular version of a particular compiler proves nothing in general case. There are well defined semantics on language level, and that's what important.<br>
<br></blockquote><div><br></div><div>This is a good explanation :)</div><div><br></div><div>David</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<a href="http://reviews.llvm.org/D18164" rel="noreferrer" target="_blank">http://reviews.llvm.org/D18164</a><br>
<br>
<br>
<br>
</blockquote></div><br></div></div>