aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_utils.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-12-13 10:39:22 +0100
committerBjörn Gustavsson <[email protected]>2017-12-15 12:31:28 +0100
commitbeb15397b746cb20d00f6585e115ac2a112b18ad (patch)
tree7e6d9bd72fbc083e839c31517b6374577c89e54a /lib/compiler/src/beam_utils.erl
parent47f61b16efe9f4304a522f54a4b630a6ffc08b06 (diff)
downloadotp-beb15397b746cb20d00f6585e115ac2a112b18ad.tar.gz
otp-beb15397b746cb20d00f6585e115ac2a112b18ad.tar.bz2
otp-beb15397b746cb20d00f6585e115ac2a112b18ad.zip
beam_utils: Improve precision for is_not_used/3
Diffstat (limited to 'lib/compiler/src/beam_utils.erl')
-rw-r--r--lib/compiler/src/beam_utils.erl13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/compiler/src/beam_utils.erl b/lib/compiler/src/beam_utils.erl
index bd1423cb40..6f20fc94de 100644
--- a/lib/compiler/src/beam_utils.erl
+++ b/lib/compiler/src/beam_utils.erl
@@ -380,9 +380,16 @@ check_liveness(R, [{bs_init,_,_,none,Ss,Dst}|Is], St) ->
check_liveness(R, [{bs_init,_,_,Live,Ss,Dst}|Is], St) ->
case R of
{x,X} ->
- case X < Live orelse member(R, Ss) of
- true -> {used,St};
- false -> {killed,St}
+ case member(R, Ss) of
+ true ->
+ {used,St};
+ false ->
+ if
+ X < Live ->
+ not_used(check_liveness(R, Is, St));
+ true ->
+ {killed,St}
+ end
end;
{y,_} ->
case member(R, Ss) of