From 541d1d89b31e8efd2e80754a396e935342c4911e Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 19 Jul 2002 11:46:31 +0000 Subject: [PATCH] [project @ 2002-07-19 11:46:31 by simonmar] Sparc NCG fix from Sven Panne: 8-byte align the stack ptr when doing a ccall. --- ghc/compiler/nativeGen/MachCode.lhs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghc/compiler/nativeGen/MachCode.lhs b/ghc/compiler/nativeGen/MachCode.lhs index 013a8eb..b4075a9 100644 --- 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))) -- 1.7.10.4