diff options
author | Björn Gustavsson <[email protected]> | 2013-05-29 13:48:52 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-05-29 15:10:23 +0200 |
commit | 2b1bf52eb71f0305247f95d4b10ba49a271a458c (patch) | |
tree | 5cdd5aa757b6bfd746bf94dabc71875a6444f459 /lib/compiler/src | |
parent | 59fc364f7426d1a05d916900b42ba7aa0fda32bc (diff) | |
download | otp-2b1bf52eb71f0305247f95d4b10ba49a271a458c.tar.gz otp-2b1bf52eb71f0305247f95d4b10ba49a271a458c.tar.bz2 otp-2b1bf52eb71f0305247f95d4b10ba49a271a458c.zip |
compiler: Correct liveness optimization for wait/1
The live optimization in beam_utils:live_opt/4 did not take into
account that the wait/1 instruction *never* falls through to
the next instruction (it has the same effect on the control flow
as the jump/1 instruction).
Diffstat (limited to 'lib/compiler/src')
-rw-r--r-- | lib/compiler/src/beam_utils.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compiler/src/beam_utils.erl b/lib/compiler/src/beam_utils.erl index 554c14f57a..e623bcc6a5 100644 --- a/lib/compiler/src/beam_utils.erl +++ b/lib/compiler/src/beam_utils.erl @@ -734,6 +734,8 @@ live_opt([{loop_rec,_Fail,_Dst}=I|Is], _, D, Acc) -> live_opt(Is, 0, D, [I|Acc]); live_opt([timeout=I|Is], _, D, Acc) -> live_opt(Is, 0, D, [I|Acc]); +live_opt([{wait,_}=I|Is], _, D, Acc) -> + live_opt(Is, 0, D, [I|Acc]); %% Transparent instructions - they neither use nor modify x registers. live_opt([{deallocate,_}=I|Is], Regs, D, Acc) -> @@ -744,8 +746,6 @@ live_opt([{try_end,_}=I|Is], Regs, D, Acc) -> live_opt(Is, Regs, D, [I|Acc]); live_opt([{loop_rec_end,_}=I|Is], Regs, D, Acc) -> live_opt(Is, Regs, D, [I|Acc]); -live_opt([{wait,_}=I|Is], Regs, D, Acc) -> - live_opt(Is, Regs, D, [I|Acc]); live_opt([{wait_timeout,_,{Tag,_}}=I|Is], Regs, D, Acc) when Tag =/= x -> live_opt(Is, Regs, D, [I|Acc]); live_opt([{line,_}=I|Is], Regs, D, Acc) -> |