summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wortmann <scpmw@leeds.ac.uk>2011-12-05 13:32:19 -0800
committerDavid Terei <davidterei@gmail.com>2011-12-05 23:09:08 -0800
commit237159c2285b4073f300c3ea5cfb471529f185fb (patch)
treef274e6ddafdc183114472ff7c16d4285d763cf37
parentfe60dd4a02e754c3e4016482d8b956a9c5247edd (diff)
downloadhaskell-237159c2285b4073f300c3ea5cfb471529f185fb.tar.gz
Code generation: Always ask for result of newSpark
Otherwise the LLVM backend gets confused over whether its type should be "void (i8*, i8*)" or "i64 (i8*, i8*)". Signed-off-by: David Terei <davidterei@gmail.com>
-rw-r--r--compiler/codeGen/CgPrimOp.hs4
-rw-r--r--compiler/codeGen/StgCmmPrim.hs3
2 files changed, 5 insertions, 2 deletions
diff --git a/compiler/codeGen/CgPrimOp.hs b/compiler/codeGen/CgPrimOp.hs
index 43a570d41e..e912a08b6e 100644
--- a/compiler/codeGen/CgPrimOp.hs
+++ b/compiler/codeGen/CgPrimOp.hs
@@ -145,7 +145,9 @@ emitPrimOp [res] SparkOp [arg] live = do
stmtC (CmmAssign (CmmLocal tmp) arg)
vols <- getVolatileRegs live
- emitForeignCall' PlayRisky []
+ res' <- newTemp bWord
+ emitForeignCall' PlayRisky
+ [CmmHinted res' NoHint]
(CmmCallee newspark CCallConv)
[ (CmmHinted (CmmReg (CmmGlobal BaseReg)) AddrHint)
, (CmmHinted arg AddrHint) ]
diff --git a/compiler/codeGen/StgCmmPrim.hs b/compiler/codeGen/StgCmmPrim.hs
index a2337aee91..1795b55165 100644
--- a/compiler/codeGen/StgCmmPrim.hs
+++ b/compiler/codeGen/StgCmmPrim.hs
@@ -223,8 +223,9 @@ emitPrimOp [res] SparkOp [arg]
-- refer to arg twice (once to pass to newSpark(), and once to
-- assign to res), so put it in a temporary.
tmp <- assignTemp arg
+ tmp2 <- newTemp bWord
emitCCall
- []
+ [(tmp2,NoHint)]
(CmmLit (CmmLabel (mkCmmCodeLabel rtsPackageId (fsLit "newSpark"))))
[(CmmReg (CmmGlobal BaseReg), AddrHint), ((CmmReg (CmmLocal tmp)), AddrHint)]
emit (mkAssign (CmmLocal res) (CmmReg (CmmLocal tmp)))