projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
180e628
)
[project @ 2002-07-19 11:46:31 by simonmar]
author
simonmar
<unknown>
Fri, 19 Jul 2002 11:46:31 +0000
(11:46 +0000)
committer
simonmar
<unknown>
Fri, 19 Jul 2002 11:46:31 +0000
(11:46 +0000)
Sparc NCG fix from Sven Panne: 8-byte align the stack ptr when doing a ccall.
ghc/compiler/nativeGen/MachCode.lhs
patch
|
blob
|
history
diff --git
a/ghc/compiler/nativeGen/MachCode.lhs
b/ghc/compiler/nativeGen/MachCode.lhs
index
013a8eb
..
b4075a9
100644
(file)
--- a/
ghc/compiler/nativeGen/MachCode.lhs
+++ b/
ghc/compiler/nativeGen/MachCode.lhs
@@
-2869,8
+2869,8
@@
genCCall fn cconv kind args
let
argcode = concatOL argcodes
(move_sp_down, move_sp_up)
- = let nn = length vregs - n_argRegs
- + 1 -- (for the road)
+ = let diff = length vregs - n_argRegs
+ nn = if odd diff then diff + 1 else diff -- keep 8-byte alignment
in if nn <= 0
then (nilOL, nilOL)
else (unitOL (moveSp (-1*nn)), unitOL (moveSp (1*nn)))