mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-30 07:00:45 +00:00
Branching or switching on trap transfers imminent undefined behavior
onto control-dependent instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102381 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
925965e6ba
commit
c30f6e1c89
@ -2318,6 +2318,15 @@ has undefined behavior.</p>
|
|||||||
Any instruction with a trap operand which may have side effects emits
|
Any instruction with a trap operand which may have side effects emits
|
||||||
those side effects as if it had an undef operand instead.</p>
|
those side effects as if it had an undef operand instead.</p>
|
||||||
|
|
||||||
|
<p>If a <a href="#i_br"><tt>br</tt></a> or
|
||||||
|
<a href="#i_switch"><tt>switch</tt></a> instruction has a trap value
|
||||||
|
operand, all non-phi non-void instructions which control-depend on it
|
||||||
|
have trap as their result value. If any instruction which
|
||||||
|
control-depends on the <tt>br</tt> or <tt>switch</tt> invokes externally
|
||||||
|
visible side effects, the behavior of the program is undefined.</p>
|
||||||
|
|
||||||
|
<!-- FIXME: What about exceptions thrown from control-dependent instrs? -->
|
||||||
|
|
||||||
<p>For example, an <a href="#i_and"><tt>and</tt></a> of a trap value with
|
<p>For example, an <a href="#i_and"><tt>and</tt></a> of a trap value with
|
||||||
zero still has a trap value result. Using that value as an index in a
|
zero still has a trap value result. Using that value as an index in a
|
||||||
<a href="#i_getelementptr"><tt>getelementptr</tt></a> yields a trap
|
<a href="#i_getelementptr"><tt>getelementptr</tt></a> yields a trap
|
||||||
|
Loading…
Reference in New Issue
Block a user