diff options
| author | Simon Marlow <marlowsd@gmail.com> | 2011-10-17 13:16:02 +0100 |
|---|---|---|
| committer | Simon Marlow <marlowsd@gmail.com> | 2011-10-17 14:51:34 +0100 |
| commit | 96c80d34163fd422cbc18f4532b7556212a554b8 (patch) | |
| tree | 2f16215825f2f32388c2dde5c07d7620c60143f0 /compiler/codeGen/StgCmmUtils.hs | |
| parent | e91ed183fdde4aa4f51b96987c7fb6fa2bfd15f5 (diff) | |
| download | haskell-96c80d34163fd422cbc18f4532b7556212a554b8.tar.gz | |
make CAFs atomic, to fix #5558
See Note [atomic CAFs] in rts/sm/Storage.c
Diffstat (limited to 'compiler/codeGen/StgCmmUtils.hs')
| -rw-r--r-- | compiler/codeGen/StgCmmUtils.hs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/compiler/codeGen/StgCmmUtils.hs b/compiler/codeGen/StgCmmUtils.hs index 509a1ebbb4..ddb87e4ffe 100644 --- a/compiler/codeGen/StgCmmUtils.hs +++ b/compiler/codeGen/StgCmmUtils.hs @@ -10,8 +10,8 @@ module StgCmmUtils ( cgLit, mkSimpleLit, emitDataLits, mkDataLits, emitRODataLits, mkRODataLits, - emitRtsCall, emitRtsCallWithVols, emitRtsCallWithResult, - assignTemp, newTemp, withTemp, + emitRtsCall, emitRtsCallWithVols, emitRtsCallWithResult, emitRtsCallGen, + assignTemp, newTemp, withTemp, newUnboxedTupleRegs, @@ -171,20 +171,20 @@ tagToClosure tycon tag ------------------------------------------------------------------------- emitRtsCall :: PackageId -> FastString -> [(CmmExpr,ForeignHint)] -> Bool -> FCode () -emitRtsCall pkg fun args safe = emitRtsCall' [] pkg fun args Nothing safe +emitRtsCall pkg fun args safe = emitRtsCallGen [] pkg fun args Nothing safe -- The 'Nothing' says "save all global registers" emitRtsCallWithVols :: PackageId -> FastString -> [(CmmExpr,ForeignHint)] -> [GlobalReg] -> Bool -> FCode () emitRtsCallWithVols pkg fun args vols safe - = emitRtsCall' [] pkg fun args (Just vols) safe + = emitRtsCallGen [] pkg fun args (Just vols) safe emitRtsCallWithResult :: LocalReg -> ForeignHint -> PackageId -> FastString -> [(CmmExpr,ForeignHint)] -> Bool -> FCode () emitRtsCallWithResult res hint pkg fun args safe - = emitRtsCall' [(res,hint)] pkg fun args Nothing safe + = emitRtsCallGen [(res,hint)] pkg fun args Nothing safe -- Make a call to an RTS C procedure -emitRtsCall' +emitRtsCallGen :: [(LocalReg,ForeignHint)] -> PackageId -> FastString @@ -192,9 +192,8 @@ emitRtsCall' -> Maybe [GlobalReg] -> Bool -- True <=> CmmSafe call -> FCode () -emitRtsCall' res pkg fun args _vols safe - = --error "emitRtsCall'" - do { updfr_off <- getUpdFrameOff +emitRtsCallGen res pkg fun args _vols safe + = do { updfr_off <- getUpdFrameOff ; emit caller_save ; emit $ call updfr_off ; emit caller_load } |
