diff options
author | Magnus Lång <[email protected]> | 2017-11-05 18:50:40 +0100 |
---|---|---|
committer | Magnus Lång <[email protected]> | 2017-11-05 20:52:48 +0100 |
commit | 14250efc69cacde4310aeb89b3b1ef631d8e5fe9 (patch) | |
tree | b61cb180f9f6b3ac2892a955b8fc9536fc0e7260 /lib/hipe/ssa | |
parent | 354f6d1c29ecaabab8a5aa3f1c95a4188a0aa542 (diff) | |
download | otp-14250efc69cacde4310aeb89b3b1ef631d8e5fe9.tar.gz otp-14250efc69cacde4310aeb89b3b1ef631d8e5fe9.tar.bz2 otp-14250efc69cacde4310aeb89b3b1ef631d8e5fe9.zip |
HiPE: Verify GC safety of derived values
HiPE has had metadata for gc safety on it's temporaries for a while, but
it has never been enforced or even checked, so naturally several
gc-safety violations has slipped through.
A new pass, hipe_rtl_verify_gcsafe verifies gcsafety on optimised RTL
and is used when running the testsuite, and can be manually enabled with
+{hipe,[verify_gcsafe]}.
Diffstat (limited to 'lib/hipe/ssa')
-rw-r--r-- | lib/hipe/ssa/hipe_ssa.inc | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/hipe/ssa/hipe_ssa.inc b/lib/hipe/ssa/hipe_ssa.inc index c7c1a8e1d7..29e8b92266 100644 --- a/lib/hipe/ssa/hipe_ssa.inc +++ b/lib/hipe/ssa/hipe_ssa.inc @@ -463,20 +463,20 @@ updateStatementDefs([], Statement, Current, Acc) -> %%---------------------------------------------------------------------- updateIndices(Current, Variable) -> - case ?CODE:is_var(Variable) of - true -> - NewVar = ?CODE:mk_new_var(), - {NewVar,gb_trees:enter(Variable, NewVar, Current)}; - false -> - case is_fp_temp(Variable) of - true -> - NewFVar = mk_new_fp_temp(), - {NewFVar,gb_trees:enter(Variable, NewFVar, Current)}; - false -> - NewReg = ?CODE:mk_new_reg(), - {NewReg,gb_trees:enter(Variable, NewReg, Current)} - end - end. + New = + case ?CODE:is_var(Variable) of + true -> ?CODE:mk_new_var(); + false -> + case is_fp_temp(Variable) of + true -> mk_new_fp_temp(); + false -> + case ?CODE:reg_is_gcsafe(Variable) of + true -> ?CODE:mk_new_reg_gcsafe(); + false -> ?CODE:mk_new_reg() + end + end + end, + {New, gb_trees:enter(Variable, New, Current)}. %%---------------------------------------------------------------------- %% Procedure : updateSuccPhi/4 |