summaryrefslogtreecommitdiff
path: root/compiler/nativeGen
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/nativeGen')
-rw-r--r--compiler/nativeGen/AsmCodeGen.lhs4
-rw-r--r--compiler/nativeGen/PPC/CodeGen.hs11
-rw-r--r--compiler/nativeGen/SPARC/CodeGen.hs4
-rw-r--r--compiler/nativeGen/X86/CodeGen.hs13
4 files changed, 15 insertions, 17 deletions
diff --git a/compiler/nativeGen/AsmCodeGen.lhs b/compiler/nativeGen/AsmCodeGen.lhs
index f56238fd12..b404e87f31 100644
--- a/compiler/nativeGen/AsmCodeGen.lhs
+++ b/compiler/nativeGen/AsmCodeGen.lhs
@@ -878,9 +878,9 @@ cmmStmtConFold stmt
src' <- cmmExprConFold DataReference src
return $ CmmStore addr' src'
- CmmJump addr regs
+ CmmJump addr
-> do addr' <- cmmExprConFold JumpReference addr
- return $ CmmJump addr' regs
+ return $ CmmJump addr'
CmmCall target regs args returns
-> do target' <- case target of
diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs
index 2fd11bc35a..8b96f7140a 100644
--- a/compiler/nativeGen/PPC/CodeGen.hs
+++ b/compiler/nativeGen/PPC/CodeGen.hs
@@ -141,8 +141,8 @@ stmtToInstrs stmt = do
CmmBranch id -> genBranch id
CmmCondBranch arg id -> genCondJump id arg
CmmSwitch arg ids -> genSwitch arg ids
- CmmJump arg _ -> genJump arg
- CmmReturn _ ->
+ CmmJump arg -> genJump arg
+ CmmReturn ->
panic "stmtToInstrs: return statement should have been cps'd away"
@@ -849,12 +849,7 @@ genCCall target dest_regs argsAndHints
case platformOS (targetPlatform dflags) of
OSLinux -> genCCall' GCPLinux target dest_regs argsAndHints
OSDarwin -> genCCall' GCPDarwin target dest_regs argsAndHints
- OSSolaris2 -> panic "PPC.CodeGen.genCCall: not defined for this os"
- OSMinGW32 -> panic "PPC.CodeGen.genCCall: not defined for this os"
- OSFreeBSD -> panic "PPC.CodeGen.genCCall: not defined for this os"
- OSOpenBSD -> panic "PPC.CodeGen.genCCall: not defined for this os"
- OSNetBSD -> panic "PPC.CodeGen.genCCall: not defined for this os"
- OSUnknown -> panic "PPC.CodeGen.genCCall: not defined for this os"
+ _ -> panic "PPC.CodeGen.genCCall: not defined for this os"
data GenCCallPlatform = GCPLinux | GCPDarwin
diff --git a/compiler/nativeGen/SPARC/CodeGen.hs b/compiler/nativeGen/SPARC/CodeGen.hs
index ff1e9f2eb2..0022e043ee 100644
--- a/compiler/nativeGen/SPARC/CodeGen.hs
+++ b/compiler/nativeGen/SPARC/CodeGen.hs
@@ -141,9 +141,9 @@ stmtToInstrs stmt = case stmt of
CmmBranch id -> genBranch id
CmmCondBranch arg id -> genCondJump id arg
CmmSwitch arg ids -> genSwitch arg ids
- CmmJump arg _ -> genJump arg
+ CmmJump arg -> genJump arg
- CmmReturn _
+ CmmReturn
-> panic "stmtToInstrs: return statement should have been cps'd away"
diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs
index 2ade04d36f..b7356ea3fd 100644
--- a/compiler/nativeGen/X86/CodeGen.hs
+++ b/compiler/nativeGen/X86/CodeGen.hs
@@ -166,8 +166,8 @@ stmtToInstrs stmt = do
CmmBranch id -> genBranch id
CmmCondBranch arg id -> genCondJump id arg
CmmSwitch arg ids -> genSwitch arg ids
- CmmJump arg _ -> genJump arg
- CmmReturn _ ->
+ CmmJump arg -> genJump arg
+ CmmReturn ->
panic "stmtToInstrs: return statement should have been cps'd away"
@@ -1690,6 +1690,7 @@ genCCall32 target dest_regs args =
use_sse2 <- sse2Enabled
push_codes <- mapM (push_arg use_sse2) (reverse args)
delta <- getDeltaNat
+ MASSERT (delta == delta0 - tot_arg_size)
-- in
-- deal with static vs dynamic call targets
@@ -1728,10 +1729,10 @@ genCCall32 target dest_regs args =
(if pop_size==0 then [] else
[ADD II32 (OpImm (ImmInt pop_size)) (OpReg esp)])
++
- [DELTA (delta + tot_arg_size)]
+ [DELTA delta0]
)
-- in
- setDeltaNat (delta + tot_arg_size)
+ setDeltaNat delta0
let
-- assign the results, if necessary
@@ -1744,9 +1745,11 @@ genCCall32 target dest_regs args =
(ImmInt 0)
sz = floatSize w
in toOL [ SUB II32 (OpImm (ImmInt b)) (OpReg esp),
+ DELTA (delta0 - b),
GST sz fake0 tmp_amode,
MOV sz (OpAddr tmp_amode) (OpReg r_dest),
- ADD II32 (OpImm (ImmInt b)) (OpReg esp)]
+ ADD II32 (OpImm (ImmInt b)) (OpReg esp),
+ DELTA delta0]
else unitOL (GMOV fake0 r_dest)
| isWord64 ty = toOL [MOV II32 (OpReg eax) (OpReg r_dest),
MOV II32 (OpReg edx) (OpReg r_dest_hi)]