diff options
author | Björn Gustavsson <[email protected]> | 2016-06-03 11:57:45 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-06-03 11:57:45 +0200 |
commit | b9f8fee6ab5088825f53bfa5dcfdca2ffa81288d (patch) | |
tree | 92ed0d8617d36ae9248195044b10c096d59285bd /lib/compiler/src/beam_block.erl | |
parent | 7d51cf9c8ce2062ed89ea6f8f24f01f826abc90b (diff) | |
parent | 819d11e4a8f67cbe5c6fa60580e47a5b884040d7 (diff) | |
download | otp-b9f8fee6ab5088825f53bfa5dcfdca2ffa81288d.tar.gz otp-b9f8fee6ab5088825f53bfa5dcfdca2ffa81288d.tar.bz2 otp-b9f8fee6ab5088825f53bfa5dcfdca2ffa81288d.zip |
Merge branch 'bjorn/compiler/misc'
* bjorn/compiler/misc:
misc_SUITE: Cover the remaining lines in beam_peep
Avoid the dreaded "no_file" in warnings
Eliminate crash for map updates in guards
beam_block: Eliminate crash in beam_utils
Diffstat (limited to 'lib/compiler/src/beam_block.erl')
-rw-r--r-- | lib/compiler/src/beam_block.erl | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/compiler/src/beam_block.erl b/lib/compiler/src/beam_block.erl index a8cfdffdf3..85d332c56e 100644 --- a/lib/compiler/src/beam_block.erl +++ b/lib/compiler/src/beam_block.erl @@ -262,12 +262,17 @@ opt_move_1(R, [{set,[D],[R],move}|Is0], Acc) -> {yes,Is} -> opt_move_rev(D, Acc, Is); no -> not_possible end; -opt_move_1({x,_}, [{set,_,_,{alloc,_,_}}|_], _) -> - %% The optimization is not possible. If the X register is not - %% killed by allocation, the optimization would not be safe. - %% If the X register is killed, it means that there cannot - %% follow a 'move' instruction with this X register as the - %% source. +opt_move_1(_R, [{set,_,_,{alloc,_,_}}|_], _) -> + %% The optimization is either not possible or not safe. + %% + %% If R is an X register killed by allocation, the optimization is + %% not safe. On the other hand, if the X register is killed, there + %% will not follow a 'move' instruction with this X register as + %% the source. + %% + %% If R is a Y register, the optimization is still not safe + %% because the new target register is an X register that cannot + %% safely pass the alloc instruction. not_possible; opt_move_1(R, [{set,_,_,_}=I|Is], Acc) -> %% If the source register is either killed or used by this |