diff options
Diffstat (limited to 'ghc/compiler/codeGen/CgPrimOp.hs')
-rw-r--r-- | ghc/compiler/codeGen/CgPrimOp.hs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ghc/compiler/codeGen/CgPrimOp.hs b/ghc/compiler/codeGen/CgPrimOp.hs index 7784efbb2b..91aa3911f8 100644 --- a/ghc/compiler/codeGen/CgPrimOp.hs +++ b/ghc/compiler/codeGen/CgPrimOp.hs @@ -10,13 +10,15 @@ module CgPrimOp ( cgPrimOp ) where +import ForeignCall ( CCallConv(CCallConv) ) import StgSyn ( StgLiveVars, StgArg ) import CgBindery ( getVolatileRegs, getArgAmodes ) import CgMonad import CgInfoTbls ( getConstrTag ) import CgUtils ( cmmOffsetW, cmmOffsetB, cmmLoadIndexW ) import Cmm -import CLabel ( mkMAP_FROZEN_infoLabel, mkMAP_DIRTY_infoLabel ) +import CLabel ( mkMAP_FROZEN_infoLabel, mkMAP_DIRTY_infoLabel, + mkDirty_MUT_VAR_Label ) import CmmUtils import MachOp import SMRep @@ -113,7 +115,14 @@ emitPrimOp [res] ReadMutVarOp [mutv] live = stmtC (CmmAssign res (cmmLoadIndexW mutv fixedHdrSize)) emitPrimOp [] WriteMutVarOp [mutv,var] live - = stmtC (CmmStore (cmmOffsetW mutv fixedHdrSize) var) + = do + stmtC (CmmStore (cmmOffsetW mutv fixedHdrSize) var) + vols <- getVolatileRegs live + stmtC (CmmCall (CmmForeignCall (CmmLit (CmmLabel mkDirty_MUT_VAR_Label)) + CCallConv) + [{-no results-}] + [(mutv,PtrHint)] + (Just vols)) -- #define sizzeofByteArrayzh(r,a) \ -- r = (((StgArrWords *)(a))->words * sizeof(W_)) |