diff options
Diffstat (limited to 'compiler/codeGen')
-rw-r--r-- | compiler/codeGen/CgForeignCall.hs | 13 | ||||
-rw-r--r-- | compiler/codeGen/CgHpc.hs | 1 | ||||
-rw-r--r-- | compiler/codeGen/CgPrimOp.hs | 3 | ||||
-rw-r--r-- | compiler/codeGen/CgUtils.hs | 2 |
4 files changed, 12 insertions, 7 deletions
diff --git a/compiler/codeGen/CgForeignCall.hs b/compiler/codeGen/CgForeignCall.hs index dd959943fb..9db66f6a64 100644 --- a/compiler/codeGen/CgForeignCall.hs +++ b/compiler/codeGen/CgForeignCall.hs @@ -73,7 +73,7 @@ emitForeignCall results (CCall (CCallSpec target cconv safety)) args live = do vols <- getVolatileRegs live srt <- getSRTInfo emitForeignCall' safety results - (CmmCallee cmm_target cconv) call_args (Just vols) srt + (CmmCallee cmm_target cconv) call_args (Just vols) srt CmmMayReturn where (call_args, cmm_target) = case target of @@ -104,13 +104,14 @@ emitForeignCall' -> [(CmmExpr,MachHint)] -- arguments -> Maybe [GlobalReg] -- live vars, in case we need to save them -> C_SRT -- the SRT of the calls continuation + -> CmmReturnInfo -> Code -emitForeignCall' safety results target args vols srt +emitForeignCall' safety results target args vols srt ret | not (playSafe safety) = do temp_args <- load_args_into_temps args let (caller_save, caller_load) = callerSaveVolatileRegs vols stmtsC caller_save - stmtC (CmmCall target results temp_args CmmUnsafe) + stmtC (CmmCall target results temp_args CmmUnsafe ret) stmtsC caller_load | otherwise = do @@ -131,12 +132,12 @@ emitForeignCall' safety results target args vols srt stmtC (CmmCall (CmmCallee suspendThread CCallConv) [ (id,PtrHint) ] [ (CmmReg (CmmGlobal BaseReg), PtrHint) ] - CmmUnsafe) - stmtC (CmmCall temp_target results temp_args CmmUnsafe) + CmmUnsafe ret) + stmtC (CmmCall temp_target results temp_args CmmUnsafe ret) stmtC (CmmCall (CmmCallee resumeThread CCallConv) [ (new_base, PtrHint) ] [ (CmmReg (CmmLocal id), PtrHint) ] - CmmUnsafe) + CmmUnsafe ret) -- Assign the result to BaseReg: we -- might now have a different Capability! stmtC (CmmAssign (CmmGlobal BaseReg) (CmmReg (CmmLocal new_base))) diff --git a/compiler/codeGen/CgHpc.hs b/compiler/codeGen/CgHpc.hs index e846f0e791..5992684d0e 100644 --- a/compiler/codeGen/CgHpc.hs +++ b/compiler/codeGen/CgHpc.hs @@ -76,6 +76,7 @@ initHpc this_mod (HpcInfo tickCount hashNo) ] (Just []) NoC_SRT -- No SRT b/c we PlayRisky + CmmMayReturn } where mod_alloc = mkFastString "hs_hpc_module" diff --git a/compiler/codeGen/CgPrimOp.hs b/compiler/codeGen/CgPrimOp.hs index 049e12a986..5ea50236de 100644 --- a/compiler/codeGen/CgPrimOp.hs +++ b/compiler/codeGen/CgPrimOp.hs @@ -121,6 +121,7 @@ emitPrimOp [res] ParOp [arg] live [(CmmReg (CmmGlobal BaseReg), PtrHint), (arg,PtrHint)] (Just vols) NoC_SRT -- No SRT b/c we do PlayRisky + CmmMayReturn where newspark = CmmLit (CmmLabel (mkRtsCodeLabel SLIT("newSpark"))) @@ -138,6 +139,7 @@ emitPrimOp [] WriteMutVarOp [mutv,var] live [(CmmReg (CmmGlobal BaseReg), PtrHint), (mutv,PtrHint)] (Just vols) NoC_SRT -- No SRT b/c we do PlayRisky + CmmMayReturn -- #define sizzeofByteArrayzh(r,a) \ -- r = (((StgArrWords *)(a))->words * sizeof(W_)) @@ -344,6 +346,7 @@ emitPrimOp [res] op args live [(a,NoHint) | a<-args] -- ToDo: hints? (Just vols) NoC_SRT -- No SRT b/c we do PlayRisky + CmmMayReturn | Just mop <- translateOp op = let stmt = CmmAssign (CmmLocal res) (CmmMachOp mop args) in diff --git a/compiler/codeGen/CgUtils.hs b/compiler/codeGen/CgUtils.hs index 9ebcf90e30..eee5f8dc85 100644 --- a/compiler/codeGen/CgUtils.hs +++ b/compiler/codeGen/CgUtils.hs @@ -354,7 +354,7 @@ emitRtsCall' res fun args vols safe = do then getSRTInfo >>= (return . CmmSafe) else return CmmUnsafe stmtsC caller_save - stmtC (CmmCall target res args safety) + stmtC (CmmCall target res args safety CmmMayReturn) stmtsC caller_load where (caller_save, caller_load) = callerSaveVolatileRegs vols |