[project @ 2000-01-25 10:22:55 by sewardj]
authorsewardj <unknown>
Tue, 25 Jan 2000 10:22:55 +0000 (10:22 +0000)
committersewardj <unknown>
Tue, 25 Jan 2000 10:22:55 +0000 (10:22 +0000)
commitb539a820b8bef70044bd7f17e013a640d8be06b7
tree7e47c601059f43890d1a16ebd990130d3672e4ec
parent0f74861a7bde7aad07fa85639a6ebb512f25feb0
[project @ 2000-01-25 10:22:55 by sewardj]
genCCall for x86, as supplied, used PUSH et al to move args onto the C
stack ready for the call.  Reasonable as this seems, it causes a
problem with spill code, since the spiller spills relative to %esp and
assumes that %esp doesn't move.  If the args of a ccall involved any
spilled values, the resulting code would be wrong.

The One True Way is to do it like a RISC: move args to the stack
without adjusting %esp for each argument, then adjust it all at once
immediately prior to the call insn and un-adjust it immediately
afterwards.  genCCall now does this.  In general, push/pop and other
C-stack effecting operations should not be generated for the same
reason.
ghc/compiler/nativeGen/MachCode.lhs