summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/cmm/CLabel.hs6
-rw-r--r--compiler/cmm/CmmPipeline.hs2
-rw-r--r--rts/sm/GC.c14
3 files changed, 16 insertions, 6 deletions
diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
index 907f8521e1..1ff76c6fe4 100644
--- a/compiler/cmm/CLabel.hs
+++ b/compiler/cmm/CLabel.hs
@@ -590,9 +590,9 @@ hasCAF _ = False
needsCDecl :: CLabel -> Bool
-- False <=> it's pre-declared; don't bother
- -- don't bother declaring SRT & Bitmap labels, we always make sure
+ -- don't bother declaring Bitmap labels, we always make sure
-- they are defined before use.
-needsCDecl (SRTLabel _ _) = False
+needsCDecl (SRTLabel _ _) = True
needsCDecl (LargeSRTLabel _) = False
needsCDecl (LargeBitmapLabel _) = False
needsCDecl (IdLabel _ _ _) = True
@@ -788,7 +788,7 @@ labelType (RtsLabel (RtsApFast _)) = CodeLabel
labelType (CaseLabel _ CaseReturnInfo) = DataLabel
labelType (CaseLabel _ _) = CodeLabel
labelType (PlainModuleInitLabel _) = CodeLabel
-labelType (SRTLabel _ _) = CodeLabel
+labelType (SRTLabel _ _) = DataLabel
labelType (LargeSRTLabel _) = DataLabel
labelType (LargeBitmapLabel _) = DataLabel
labelType (ForeignLabel _ _ _ IsFunction) = CodeLabel
diff --git a/compiler/cmm/CmmPipeline.hs b/compiler/cmm/CmmPipeline.hs
index 76927266ad..25fda1ca07 100644
--- a/compiler/cmm/CmmPipeline.hs
+++ b/compiler/cmm/CmmPipeline.hs
@@ -82,7 +82,7 @@ cpsTop hsc_env (CmmProc h@(TopInfo {stack_info=StackInfo {arg_space=entry_off}})
return call_pps
let noncall_pps = proc_points `setDifference` call_pps
- when (not (setNull noncall_pps)) $
+ when (not (setNull noncall_pps) && dopt Opt_D_dump_cmmz dflags) $
pprTrace "Non-call proc points: " (ppr noncall_pps) $ return ()
----------- Sink and inline assignments *before* stack layout -----------
diff --git a/rts/sm/GC.c b/rts/sm/GC.c
index 7bdaef5868..93606451cf 100644
--- a/rts/sm/GC.c
+++ b/rts/sm/GC.c
@@ -404,6 +404,10 @@ GarbageCollect (nat collect_gen,
break;
}
+ if (n_gc_threads != 1) {
+ gct->allocated = clearNursery(cap);
+ }
+
shutdown_gc_threads(gct->thread_index);
// Now see which stable names are still alive.
@@ -636,9 +640,15 @@ GarbageCollect (nat collect_gen,
allocated += clearNursery(&capabilities[n]);
}
} else {
- gct->allocated = clearNursery(cap);
+ // When doing parallel GC, clearNursery() is called by the
+ // worker threads, and the value returned is stored in
+ // gct->allocated.
for (n = 0; n < n_capabilities; n++) {
- allocated += gc_threads[n]->allocated;
+ if (gc_threads[n]->idle) {
+ allocated += clearNursery(&capabilities[n]);
+ } else {
+ allocated += gc_threads[n]->allocated;
+ }
}
}