[commit: ghc] master: Add a missing write barrier to small array writes (8be27c0)

git at git.haskell.org git at git.haskell.org
Sat Oct 6 14:54:39 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/8be27c0371d53e051d59ba20dd65103bbb8d32d3/ghc

>---------------------------------------------------------------

commit 8be27c0371d53e051d59ba20dd65103bbb8d32d3
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date:   Sat Oct 6 17:53:06 2018 +0300

    Add a missing write barrier to small array writes
    
    Write barriers for large array writes were added in D2525, as a part of #12469.
    However it seems we forgot about small arrays. This patch adds the same write
    barrier to small array writes.
    
    Reviewers: simonmar, bgamari
    
    Reviewed By: simonmar
    
    Subscribers: rwbarton, carter
    
    GHC Trac Issues: #12469
    
    Differential Revision: https://phabricator.haskell.org/D5209


>---------------------------------------------------------------

8be27c0371d53e051d59ba20dd65103bbb8d32d3
 compiler/codeGen/StgCmmPrim.hs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler/codeGen/StgCmmPrim.hs b/compiler/codeGen/StgCmmPrim.hs
index 266ab3a..f5437c0 100644
--- a/compiler/codeGen/StgCmmPrim.hs
+++ b/compiler/codeGen/StgCmmPrim.hs
@@ -2295,6 +2295,7 @@ doWriteSmallPtrArrayOp :: CmmExpr
 doWriteSmallPtrArrayOp addr idx val = do
     dflags <- getDynFlags
     let ty = cmmExprType dflags val
+    emitPrimCall [] MO_WriteBarrier [] -- #12469
     mkBasicIndexedWrite (smallArrPtrsHdrSize dflags) Nothing addr ty idx val
     emit (setInfo addr (CmmLit (CmmLabel mkSMAP_DIRTY_infoLabel)))
 



More information about the ghc-commits mailing list