[project @ 2002-07-19 11:46:31 by simonmar]
authorsimonmar <unknown>
Fri, 19 Jul 2002 11:46:31 +0000 (11:46 +0000)
committersimonmar <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

index 013a8eb..b4075a9 100644 (file)
@@ -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)))