$I1 = 1
.local int i
i = 2
print i # prints 1, not 2
parrot -o - t.imc shows:
set I16, 1
set I16, 2
Is this a bug, or am I missing something?
PS this happens on pow builds 0.0.11 (20/09/03), and 15/11/03
Yep. The problem seems to be the backward branch. When you put the
"test" sub after the "end" op, its working fine.
At quick glance I would guess IMCC assumes that the "call test" branches
to a basic block that doesn't overlap with the callee basic block.
Much (most) of the flow analysis code was done before we adopted
new calling conventions. I'll have a look to see if there a quick fix
that would allow the code snippet sample to be legal.
As Leo said, it is backward branch. $I1 and $I2 can both get stored in
the same register, as can .local int i and .local int j. I'm just
pointing out that my subject line was a little misleading.