x86 codegen bug

Matthew Fluet mfluet@intertrust.com
Tue, 24 Jul 2001 12:07:07 -0700 (PDT)


It is a codegen bug.  I think it's fixed in the new codegen.

Essentially, the machine IL has:
RP(6) = XP(RP(5),SI(100))
...
SP(100) = RP(6)

Nothing in ... aliases SP(100), so I hoist that move to
SP(100) = XP(RP(5),SI(100))
...

And that's the last def of SP(100) before a CPS function call, so I want
to remove SP(100) from the register file and commit it to memory.  And,
for some reason, related to the fact that SI(100) is an alias for SP(100)
and SI(100) is utilized by XP(...), the post instruction phase is missing
the fact that SP(100) has been defed and needs to be written to memory.

The new codegen doesn't exhibit the bug.  The reasoning in the post
instruction phase has been rewritten, and I think that will get it.  But,
due to some other aspects of the new codegen, I'm not writting SP(100) to
memory until a bit later (which is good from the point of view that it
doesn't raise the bug, but bad from the point of view that I hold onto
SP(100) in a register much too long).

Anyways, I'll port the appropriate changes from the new codegen's post
instruction phase to the old codegen, and see if that gets the bug.  And
I'll fix the new codegen to not delay writes for so long.