[commit: ghc] master: CmmParse: Don't force alignment in memcpy-ish operations (64b6733)

git at git.haskell.org git at git.haskell.org
Mon Aug 3 15:21:05 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/64b6733e217f32feb8c4872096749c6f417d0c39/ghc

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

commit 64b6733e217f32feb8c4872096749c6f417d0c39
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Mon Aug 3 15:31:03 2015 +0200

    CmmParse: Don't force alignment in memcpy-ish operations
    
    This was initially made in 681973c31c614185229bdae4f6b7ab4f6e64753d.
    Here I wanted to enforce that the alignment passed to %memcpy was a
    constant expression, as this is required by LLVM. However, this breaks
    the knot-tying done in `loopDecls`, causing T8131 to hang.
    
    Here I remove the `seq` and mark T8131 as `expect_broken` in the case
    of the NCG, which doesn't force the alignment in this case.
    
    Fixes #10664.


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

64b6733e217f32feb8c4872096749c6f417d0c39
 compiler/cmm/CmmParse.y                   | 3 +--
 testsuite/tests/codeGen/should_fail/all.T | 4 +++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/compiler/cmm/CmmParse.y b/compiler/cmm/CmmParse.y
index 9638c14..ea0f4a5 100644
--- a/compiler/cmm/CmmParse.y
+++ b/compiler/cmm/CmmParse.y
@@ -988,8 +988,7 @@ callishMachOps = listToUFM $
     memcpyLikeTweakArgs :: (Int -> CallishMachOp) -> [CmmExpr] -> (CallishMachOp, [CmmExpr])
     memcpyLikeTweakArgs op [] = pgmError "memcpy-like function requires at least one argument"
     memcpyLikeTweakArgs op args@(_:_) =
-        -- Force alignment with result to ensure pprPgmError fires
-        align `seq` (op align, args')
+        (op align, args')
       where
         args' = init args
         align = case last args of
diff --git a/testsuite/tests/codeGen/should_fail/all.T b/testsuite/tests/codeGen/should_fail/all.T
index 39faebb..7e25b5f 100644
--- a/testsuite/tests/codeGen/should_fail/all.T
+++ b/testsuite/tests/codeGen/should_fail/all.T
@@ -1,3 +1,5 @@
 # Tests for code generator and CMM parser
 
-test('T8131', cmm_src, compile_fail, [''])
+# Only the LLVM code generator consistently forces the alignment of
+# memcpy operations
+test('T8131', [cmm_src, only_ways(llvm_ways)], compile_fail, [''])



More information about the ghc-commits mailing list