[PATCH] D18164: [tsan] Do not instrument reads/writes to instruction profile counters.

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 13:23:06 PDT 2016


dvyukov added a comment.

> 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?


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.
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.


http://reviews.llvm.org/D18164





More information about the llvm-commits mailing list