Skip to content

Commit 7a5faab

Browse files
committed
LangRef: storing poison in memory is UB
1 parent af2a957 commit 7a5faab

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/docs/LangRef.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11433,6 +11433,12 @@ If ``<value>`` is of aggregate type, padding is filled with
1143311433
:ref:`undef <undefvalues>`.
1143411434
If ``<pointer>`` is not a well-defined value, the behavior is undefined.
1143511435

11436+
If ``<value>`` is poison, then behavior currently is effectively undefined due
11437+
to the fact that many LLVM passes assume they can do load widening, and having
11438+
poison in memory would "infect" the entire widened load. This can hopefully be
11439+
alleviated in the future, but until then, frontends should refrain from
11440+
generating code that stores poison values in memory.
11441+
1143611442
Example:
1143711443
""""""""
1143811444

0 commit comments

Comments
 (0)