aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2018-02-28 14:59:57 +0100
committerBjörn Gustavsson <[email protected]>2018-03-01 11:51:17 +0100
commite97bef322f6bd1701b1dd4b936efdf32562bcbfe (patch)
tree53ae986530f156f342fd5d126a7ff4f037c1f7d9 /lib/compiler/src
parent88c4c305636618af4002c8c484083668a88824e9 (diff)
downloadotp-e97bef322f6bd1701b1dd4b936efdf32562bcbfe.tar.gz
otp-e97bef322f6bd1701b1dd4b936efdf32562bcbfe.tar.bz2
otp-e97bef322f6bd1701b1dd4b936efdf32562bcbfe.zip
beam_utils: Correct is_killed/3, is_killed_at/3, is_used/3
is_killed/3 and is_killed_at/3 could return 'true' even if the register was referenced by an allocation instruction. Somehow, that does not seem to have caused any problems yet.
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/beam_utils.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/compiler/src/beam_utils.erl b/lib/compiler/src/beam_utils.erl
index a57dbbbc2f..7031fe8bfe 100644
--- a/lib/compiler/src/beam_utils.erl
+++ b/lib/compiler/src/beam_utils.erl
@@ -118,7 +118,7 @@ is_killed(R, Is, D) ->
St = #live{lbl=D,res=gb_trees:empty()},
case check_liveness(R, Is, St) of
{killed,_} -> true;
- {exit_not_used,_} -> true;
+ {exit_not_used,_} -> false;
{_,_} -> false
end.
@@ -131,7 +131,7 @@ is_killed_at(R, Lbl, D) when is_integer(Lbl) ->
St0 = #live{lbl=D,res=gb_trees:empty()},
case check_liveness_at(R, Lbl, St0) of
{killed,_} -> true;
- {exit_not_used,_} -> true;
+ {exit_not_used,_} -> false;
{_,_} -> false
end.
@@ -148,7 +148,7 @@ is_not_used(R, Is, D) ->
St = #live{lbl=D,res=gb_trees:empty()},
case check_liveness(R, Is, St) of
{used,_} -> false;
- {exit_not_used,_} -> false;
+ {exit_not_used,_} -> true;
{_,_} -> true
end.