diff options
author | Peter Wortmann <scpmw@leeds.ac.uk> | 2011-12-05 13:32:19 -0800 |
---|---|---|
committer | David Terei <davidterei@gmail.com> | 2011-12-05 23:09:08 -0800 |
commit | 237159c2285b4073f300c3ea5cfb471529f185fb (patch) | |
tree | f274e6ddafdc183114472ff7c16d4285d763cf37 | |
parent | fe60dd4a02e754c3e4016482d8b956a9c5247edd (diff) | |
download | haskell-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.hs | 4 | ||||
-rw-r--r-- | compiler/codeGen/StgCmmPrim.hs | 3 |
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))) |