summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-09-11 15:28:12 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-09-11 15:28:12 +0000
commit2c03cc795693fcedc03bfaa3dbbdad435ed01aeb (patch)
tree153aaadd4b00d41fb581ba47b1ff0fb85b267b41
parentd64900abb0ddc2f2ab52948cc274f2adc864a6dc (diff)
downloadhaskell-2c03cc795693fcedc03bfaa3dbbdad435ed01aeb.tar.gz
Fix a space leak in the native code gen (again)
-rw-r--r--compiler/nativeGen/AsmCodeGen.lhs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/nativeGen/AsmCodeGen.lhs b/compiler/nativeGen/AsmCodeGen.lhs
index b7e4797720..a99d60ac9d 100644
--- a/compiler/nativeGen/AsmCodeGen.lhs
+++ b/compiler/nativeGen/AsmCodeGen.lhs
@@ -236,19 +236,19 @@ cmmNativeGens dflags h us (cmm : cmms) impAcc profAcc count
Pretty.bufLeftRender h
$ {-# SCC "pprNativeCode" #-} Pretty.vcat $ map pprNatCmmTop native
- let lsPprNative =
+ -- carefully evaluate this strictly. Binding it with 'let'
+ -- and then using 'seq' doesn't work, because the let
+ -- apparently gets inlined first.
+ lsPprNative <- return $!
if dopt Opt_D_dump_asm dflags
|| dopt Opt_D_dump_asm_stats dflags
then native
else []
- let count' = count + 1;
-
+ count' <- return $! count + 1;
-- force evaulation all this stuff to avoid space leaks
seqString (showSDoc $ vcat $ map ppr imports) `seq` return ()
- lsPprNative `seq` return ()
- count' `seq` return ()
cmmNativeGens dflags h us' cmms
(imports : impAcc)