[PATCH] D65134: Clarify where the indirect UB due to write-write races comes from

Ralf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 02:16:49 PDT 2019


RalfJung created this revision.
RalfJung added reviewers: sylvestre.ledru, majnemer, efriedma, eli.friedman.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This is based on https://bugs.llvm.org/show_bug.cgi?id=42435#c3.


Repository:
  rL LLVM

https://reviews.llvm.org/D65134

Files:
  llvm/docs/Atomics.rst


Index: llvm/docs/Atomics.rst
===================================================================
--- llvm/docs/Atomics.rst
+++ llvm/docs/Atomics.rst
@@ -87,8 +87,10 @@
 
 However, LLVM is not allowed to transform the former to the latter: it could
 indirectly introduce undefined behavior if another thread can access ``x`` at
-the same time. (This example is particularly of interest because before the
-concurrency model was implemented, LLVM would perform this transformation.)
+the same time. That thread would read `undef` instead of the value it was
+expecting, which can lead to undefined behavior down the line. (This example is
+particularly of interest because before the concurrency model was implemented,
+LLVM would perform this transformation.)
 
 Note that speculative loads are allowed; a load which is part of a race returns
 ``undef``, but does not have undefined behavior.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65134.211263.patch
Type: text/x-patch
Size: 892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190723/a176bd07/attachment.bin>


More information about the llvm-commits mailing list