Fix non ssa issue

register instances were being shared across instructions
causing the setting to have side-effects
Fixed this by copying the register on write
(fixing the symptom rather than the cause, i'll make an issue)
This commit is contained in:
2020-03-20 18:33:37 +02:00
parent d2e7c647d0
commit 06ade75593
5 changed files with 19 additions and 23 deletions

View File

@ -13,7 +13,7 @@ module Risc
end
def test_allocate_runs
assert_nil @allocator.allocate_regs
#assert_equal 0 , @allocator.used_regs.length
assert_equal 0 , @allocator.used_regs.length
end
def test_live_length
live = @allocator.walk_and_mark(@compiler.risc_instructions)