Fix ghc-zeromq4-haskell on powerpc64 and powerpc64le. Make parallel builds a bit more reliable on PowerPC. OBS-URL: https://build.opensuse.org/request/show/430597 OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc?expand=0&rev=226
19 lines
962 B
Diff
19 lines
962 B
Diff
Index: ghc-8.0.1/compiler/codeGen/StgCmmPrim.hs
|
|
===================================================================
|
|
--- ghc-8.0.1.orig/compiler/codeGen/StgCmmPrim.hs
|
|
+++ ghc-8.0.1/compiler/codeGen/StgCmmPrim.hs
|
|
@@ -310,8 +310,11 @@ emitPrimOp _ [res] GetCurrentCCSOp [_dum
|
|
emitPrimOp dflags [res] ReadMutVarOp [mutv]
|
|
= emitAssign (CmmLocal res) (cmmLoadIndexW dflags mutv (fixedHdrSizeW dflags) (gcWord dflags))
|
|
|
|
-emitPrimOp dflags [] WriteMutVarOp [mutv,var]
|
|
- = do emitStore (cmmOffsetW dflags mutv (fixedHdrSizeW dflags)) var
|
|
+emitPrimOp dflags res@[] WriteMutVarOp [mutv,var]
|
|
+ = do -- Without this write barrier, other CPUs may see this pointer before
|
|
+ -- the writes for the closure it points to have occurred.
|
|
+ emitPrimCall res MO_WriteBarrier []
|
|
+ emitStore (cmmOffsetW dflags mutv (fixedHdrSizeW dflags)) var
|
|
emitCCall
|
|
[{-no results-}]
|
|
(CmmLit (CmmLabel mkDirty_MUT_VAR_Label))
|