Register swap bug when generating Phi moves #44
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I couldn't simplify the code so I'm gonna provide the code as is
when I comment out
io.writeLine(output_pos)program crasheshere is some variations of this program only print changes
I have no idea how printing some numbers effect the calculation of other numbers I'm really confused
This seems to be the result of an optimization.
There is some code in the assembler that will recognize patterns like these:
think of it as
...and it will drop the 2nd instruction because it is effectively a no-op.
However, this pattern is actually searched in the cycle detection and it should have caused a compiler panic, saying "cycle detected" because the automatic addition of a temporary register is not implemented yet.
The optimization dropped the second instruction which prevented the detection of the cycle.
To fix this, 2 things need to be implemented:
Fixed in
aea6a304c4.Lifetime Bugto Register swap bug when generating Phi movesReopening because it's actually not completely fixed yet.
The move reordering ignores loads and stores from memory which causes x86-64 with only 16 registers to produce incorrect values, given enough register pressure.
The fix is to handle loads and stores during reordering.
Fixed in
6a59c5a371.Can confirm code is now working
Further improvements to the move scheduler in
48c81d0d9e, hopefully the last commit in regard to this problem.