summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToC.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/CmmToC.hs')
-rw-r--r--compiler/GHC/CmmToC.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/GHC/CmmToC.hs b/compiler/GHC/CmmToC.hs
index 6e6f58ba7d..7944f6a0fc 100644
--- a/compiler/GHC/CmmToC.hs
+++ b/compiler/GHC/CmmToC.hs
@@ -406,7 +406,7 @@ pprLoad dflags e ty
-- (For tagging to work, I had to avoid unaligned loads. --ARY)
-> pprAsPtrReg r <> brackets (ppr (off `shiftR` wordShift dflags))
- _other -> cLoad e ty
+ _other -> cLoad (targetPlatform dflags) e ty
where
width = typeWidth ty
@@ -1145,10 +1145,9 @@ te_Reg _ = return ()
cCast :: SDoc -> CmmExpr -> SDoc
cCast ty expr = parens ty <> pprExpr1 expr
-cLoad :: CmmExpr -> CmmType -> SDoc
-cLoad expr rep
- = sdocWithPlatform $ \platform ->
- if bewareLoadStoreAlignment (platformArch platform)
+cLoad :: Platform -> CmmExpr -> CmmType -> SDoc
+cLoad platform expr rep
+ = if bewareLoadStoreAlignment (platformArch platform)
then let decl = machRepCType rep <+> text "x" <> semi
struct = text "struct" <+> braces (decl)
packed_attr = text "__attribute__((packed))"