Commit 0a6f26f6 authored by Ian Lynagh's avatar Ian Lynagh

Fix gcc 4.6 warnings; fixes #5176

Based on a patch from David Terei.

Some parts are a little ugly (e.g. defining things that only ASSERTs
use only when DEBUG is defined), so we might want to tweak things a
little.

I've also turned off -Werror for didn't-inline warnings, as we now
get a few such warnings.
parent 12b93887
...@@ -742,7 +742,8 @@ if test -z "$GCC" ...@@ -742,7 +742,8 @@ if test -z "$GCC"
then then
AC_MSG_ERROR([gcc is required]) AC_MSG_ERROR([gcc is required])
fi fi
GccLT34= GccLT34=NO
GccLT46=NO
AC_CACHE_CHECK([version of gcc], [fp_cv_gcc_version], AC_CACHE_CHECK([version of gcc], [fp_cv_gcc_version],
[ [
fp_cv_gcc_version="`$CC -v 2>&1 | grep 'version ' | sed -e 's/.*version [[^0-9]]*\([[0-9.]]*\).*/\1/g'`" fp_cv_gcc_version="`$CC -v 2>&1 | grep 'version ' | sed -e 's/.*version [[^0-9]]*\([[0-9.]]*\).*/\1/g'`"
...@@ -752,9 +753,11 @@ AC_CACHE_CHECK([version of gcc], [fp_cv_gcc_version], ...@@ -752,9 +753,11 @@ AC_CACHE_CHECK([version of gcc], [fp_cv_gcc_version],
# isn't a very good reason for that, but for now just make configure # isn't a very good reason for that, but for now just make configure
# fail. # fail.
FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [3.4], GccLT34=YES) FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [3.4], GccLT34=YES)
FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [4.6], GccLT46=YES)
]) ])
AC_SUBST([GccVersion], [$fp_cv_gcc_version]) AC_SUBST([GccVersion], [$fp_cv_gcc_version])
AC_SUBST(GccLT34) AC_SUBST(GccLT34)
AC_SUBST(GccLT46)
])# FP_GCC_VERSION ])# FP_GCC_VERSION
dnl Small feature test for perl version. Assumes PerlCmd dnl Small feature test for perl version. Assumes PerlCmd
......
...@@ -535,6 +535,7 @@ endif ...@@ -535,6 +535,7 @@ endif
WhatGccIsCalled = @WhatGccIsCalled@ WhatGccIsCalled = @WhatGccIsCalled@
GccVersion = @GccVersion@ GccVersion = @GccVersion@
GccLT34 = @GccLT34@ GccLT34 = @GccLT34@
GccLT46 = @GccLT46@
CC = $(WhatGccIsCalled) CC = $(WhatGccIsCalled)
CC_STAGE0 = @CC_STAGE0@ CC_STAGE0 = @CC_STAGE0@
CC_STAGE1 = $(CC) CC_STAGE1 = $(CC)
......
...@@ -4,7 +4,16 @@ ...@@ -4,7 +4,16 @@
WERROR = -Werror WERROR = -Werror
HADDOCK_DOCS = YES HADDOCK_DOCS = YES
SRC_CC_OPTS += -Wall $(WERROR) SRC_CC_OPTS += -Wall $(WERROR)
# Debian doesn't turn -Werror=unused-but-set-variable on by default, so
# we turn it on explicitly for consistency with other users
ifeq "$(GccLT46)" "NO"
SRC_CC_OPTS += -Werror=unused-but-set-variable
endif
# gcc 4.6 gives 3 warning for giveCapabilityToTask not being inlined
SRC_CC_OPTS += -Wno-error=inline
SRC_HC_OPTS += -Wall $(WERROR) -H64m -O0 SRC_HC_OPTS += -Wall $(WERROR) -H64m -O0
# Safe by default # Safe by default
......
...@@ -49,13 +49,21 @@ ...@@ -49,13 +49,21 @@
/* Sp points to the lowest live word on the stack. */ /* Sp points to the lowest live word on the stack. */
#define BCO_NEXT instrs[bciPtr++] #define BCO_NEXT instrs[bciPtr++]
#define BCO_NEXT_32 (bciPtr += 2, (((StgWord) instrs[bciPtr-2]) << 16) + ((StgWord) instrs[bciPtr-1])) #define BCO_NEXT_32 (bciPtr += 2)
#define BCO_NEXT_64 (bciPtr += 4, (((StgWord) instrs[bciPtr-4]) << 48) + (((StgWord) instrs[bciPtr-3]) << 32) + (((StgWord) instrs[bciPtr-2]) << 16) + ((StgWord) instrs[bciPtr-1])) #define BCO_READ_NEXT_32 (BCO_NEXT_32, (((StgWord) instrs[bciPtr-2]) << 16) \
+ ( (StgWord) instrs[bciPtr-1]))
#define BCO_NEXT_64 (bciPtr += 4)
#define BCO_READ_NEXT_64 (BCO_NEXT_64, (((StgWord) instrs[bciPtr-4]) << 48) \
+ (((StgWord) instrs[bciPtr-3]) << 32) \
+ (((StgWord) instrs[bciPtr-2]) << 16) \
+ ( (StgWord) instrs[bciPtr-1]))
#if WORD_SIZE_IN_BITS == 32 #if WORD_SIZE_IN_BITS == 32
#define BCO_NEXT_WORD BCO_NEXT_32 #define BCO_NEXT_WORD BCO_NEXT_32
#define BCO_READ_NEXT_WORD BCO_READ_NEXT_32
#elif WORD_SIZE_IN_BITS == 64 #elif WORD_SIZE_IN_BITS == 64
#define BCO_NEXT_WORD BCO_NEXT_64 #define BCO_NEXT_WORD BCO_NEXT_64
#define BCO_READ_NEXT_WORD BCO_READ_NEXT_64
#else #else
#error Cannot cope with WORD_SIZE_IN_BITS being nether 32 nor 64 #error Cannot cope with WORD_SIZE_IN_BITS being nether 32 nor 64
#endif #endif
...@@ -776,8 +784,12 @@ run_BCO: ...@@ -776,8 +784,12 @@ run_BCO:
register StgWord16* instrs = (StgWord16*)(bco->instrs->payload); register StgWord16* instrs = (StgWord16*)(bco->instrs->payload);
register StgWord* literals = (StgWord*)(&bco->literals->payload[0]); register StgWord* literals = (StgWord*)(&bco->literals->payload[0]);
register StgPtr* ptrs = (StgPtr*)(&bco->ptrs->payload[0]); register StgPtr* ptrs = (StgPtr*)(&bco->ptrs->payload[0]);
#ifdef DEBUG
int bcoSize; int bcoSize;
bcoSize = BCO_NEXT_WORD; bcoSize = BCO_READ_NEXT_WORD;
#else
BCO_NEXT_WORD;
#endif
IF_DEBUG(interpreter,debugBelch("bcoSize = %d\n", bcoSize)); IF_DEBUG(interpreter,debugBelch("bcoSize = %d\n", bcoSize));
#ifdef INTERP_STATS #ifdef INTERP_STATS
......
...@@ -1190,11 +1190,15 @@ initLinker( void ) ...@@ -1190,11 +1190,15 @@ initLinker( void )
compileResult = regcomp(&re_invalid, compileResult = regcomp(&re_invalid,
"(([^ \t()])+\\.so([^ \t:()])*):([ \t])*(invalid ELF header|file too short)", "(([^ \t()])+\\.so([^ \t:()])*):([ \t])*(invalid ELF header|file too short)",
REG_EXTENDED); REG_EXTENDED);
ASSERT( compileResult == 0 ); if (compileResult != 0) {
barf("Compiling re_invalid failed");
}
compileResult = regcomp(&re_realso, compileResult = regcomp(&re_realso,
"(GROUP|INPUT) *\\( *(([^ )])+)", "(GROUP|INPUT) *\\( *(([^ )])+)",
REG_EXTENDED); REG_EXTENDED);
ASSERT( compileResult == 0 ); if (compileResult != 0) {
barf("Compiling re_realso failed");
}
# endif # endif
#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) #if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH)
...@@ -4124,10 +4128,14 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, ...@@ -4124,10 +4128,14 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC,
Elf_Addr P = ((Elf_Addr)targ) + offset; Elf_Addr P = ((Elf_Addr)targ) + offset;
Elf_Word* pP = (Elf_Word*)P; Elf_Word* pP = (Elf_Word*)P;
#if defined(i386_HOST_ARCH) || defined(DEBUG)
Elf_Addr A = *pP; Elf_Addr A = *pP;
#endif
Elf_Addr S; Elf_Addr S;
void* S_tmp; void* S_tmp;
#ifdef i386_HOST_ARCH
Elf_Addr value; Elf_Addr value;
#endif
StgStablePtr stablePtr; StgStablePtr stablePtr;
StgPtr stableVal; StgPtr stableVal;
...@@ -4171,7 +4179,9 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, ...@@ -4171,7 +4179,9 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC,
(void*)P, (void*)S, (void*)A )); (void*)P, (void*)S, (void*)A ));
checkProddableBlock ( oc, pP ); checkProddableBlock ( oc, pP );
#ifdef i386_HOST_ARCH
value = S + A; value = S + A;
#endif
switch (ELF_R_TYPE(info)) { switch (ELF_R_TYPE(info)) {
# ifdef i386_HOST_ARCH # ifdef i386_HOST_ARCH
......
...@@ -839,7 +839,7 @@ heapCensusChain( Census *census, bdescr *bd ) ...@@ -839,7 +839,7 @@ heapCensusChain( Census *census, bdescr *bd )
nat size; nat size;
counter *ctr; counter *ctr;
nat real_size; nat real_size;
rtsBool prim; PROFILING_ONLY( rtsBool prim );
for (; bd != NULL; bd = bd->link) { for (; bd != NULL; bd = bd->link) {
...@@ -854,7 +854,7 @@ heapCensusChain( Census *census, bdescr *bd ) ...@@ -854,7 +854,7 @@ heapCensusChain( Census *census, bdescr *bd )
p = bd->start; p = bd->start;
while (p < bd->free) { while (p < bd->free) {
info = get_itbl((StgClosure *)p); info = get_itbl((StgClosure *)p);
prim = rtsFalse; PROFILING_ONLY( prim = rtsFalse );
switch (info->type) { switch (info->type) {
...@@ -904,7 +904,7 @@ heapCensusChain( Census *census, bdescr *bd ) ...@@ -904,7 +904,7 @@ heapCensusChain( Census *census, bdescr *bd )
break; break;
case BCO: case BCO:
prim = rtsTrue; PROFILING_ONLY ( prim = rtsTrue );
size = bco_sizeW((StgBCO *)p); size = bco_sizeW((StgBCO *)p);
break; break;
...@@ -915,7 +915,7 @@ heapCensusChain( Census *census, bdescr *bd ) ...@@ -915,7 +915,7 @@ heapCensusChain( Census *census, bdescr *bd )
case MUT_PRIM: case MUT_PRIM:
case MUT_VAR_CLEAN: case MUT_VAR_CLEAN:
case MUT_VAR_DIRTY: case MUT_VAR_DIRTY:
prim = rtsTrue; PROFILING_ONLY ( prim = rtsTrue );
size = sizeW_fromITBL(info); size = sizeW_fromITBL(info);
break; break;
...@@ -932,7 +932,7 @@ heapCensusChain( Census *census, bdescr *bd ) ...@@ -932,7 +932,7 @@ heapCensusChain( Census *census, bdescr *bd )
break; break;
case ARR_WORDS: case ARR_WORDS:
prim = rtsTrue; PROFILING_ONLY ( prim = rtsTrue );
size = arr_words_sizeW((StgArrWords*)p); size = arr_words_sizeW((StgArrWords*)p);
break; break;
...@@ -940,12 +940,12 @@ heapCensusChain( Census *census, bdescr *bd ) ...@@ -940,12 +940,12 @@ heapCensusChain( Census *census, bdescr *bd )
case MUT_ARR_PTRS_DIRTY: case MUT_ARR_PTRS_DIRTY:
case MUT_ARR_PTRS_FROZEN: case MUT_ARR_PTRS_FROZEN:
case MUT_ARR_PTRS_FROZEN0: case MUT_ARR_PTRS_FROZEN0:
prim = rtsTrue; PROFILING_ONLY ( prim = rtsTrue );
size = mut_arr_ptrs_sizeW((StgMutArrPtrs *)p); size = mut_arr_ptrs_sizeW((StgMutArrPtrs *)p);
break; break;
case TSO: case TSO:
prim = rtsTrue; PROFILING_ONLY ( prim = rtsTrue );
#ifdef PROFILING #ifdef PROFILING
if (RtsFlags.ProfFlags.includeTSOs) { if (RtsFlags.ProfFlags.includeTSOs) {
size = sizeofW(StgTSO); size = sizeofW(StgTSO);
...@@ -961,7 +961,7 @@ heapCensusChain( Census *census, bdescr *bd ) ...@@ -961,7 +961,7 @@ heapCensusChain( Census *census, bdescr *bd )
#endif #endif
case STACK: case STACK:
prim = rtsTrue; PROFILING_ONLY ( prim = rtsTrue );
#ifdef PROFILING #ifdef PROFILING
if (RtsFlags.ProfFlags.includeTSOs) { if (RtsFlags.ProfFlags.includeTSOs) {
size = stack_sizeW((StgStack*)p); size = stack_sizeW((StgStack*)p);
...@@ -977,7 +977,7 @@ heapCensusChain( Census *census, bdescr *bd ) ...@@ -977,7 +977,7 @@ heapCensusChain( Census *census, bdescr *bd )
#endif #endif
case TREC_CHUNK: case TREC_CHUNK:
prim = rtsTrue; PROFILING_ONLY ( prim = rtsTrue );
size = sizeofW(StgTRecChunk); size = sizeofW(StgTRecChunk);
break; break;
......
...@@ -12,6 +12,13 @@ ...@@ -12,6 +12,13 @@
#include <stdio.h> #include <stdio.h>
#include "BeginPrivate.h" #include "BeginPrivate.h"
#include "Rts.h"
#ifdef PROFILING
#define PROFILING_ONLY(s) s
#else
#define PROFILING_ONLY(s) doNothing()
#endif
void initProfiling1 (void); void initProfiling1 (void);
void initProfiling2 (void); void initProfiling2 (void);
......
...@@ -1089,7 +1089,7 @@ static void disconnect_invariant(Capability *cap, ...@@ -1089,7 +1089,7 @@ static void disconnect_invariant(Capability *cap,
FOR_EACH_ENTRY(last_execution, e, { FOR_EACH_ENTRY(last_execution, e, {
StgTVar *s = e -> tvar; StgTVar *s = e -> tvar;
StgTVarWatchQueue *q = s -> first_watch_queue_entry; StgTVarWatchQueue *q = s -> first_watch_queue_entry;
StgBool found = FALSE; DEBUG_ONLY( StgBool found = FALSE );
TRACE(" looking for trec on tvar=%p", s); TRACE(" looking for trec on tvar=%p", s);
for (q = s -> first_watch_queue_entry; for (q = s -> first_watch_queue_entry;
q != END_STM_WATCH_QUEUE; q != END_STM_WATCH_QUEUE;
...@@ -1110,7 +1110,7 @@ static void disconnect_invariant(Capability *cap, ...@@ -1110,7 +1110,7 @@ static void disconnect_invariant(Capability *cap,
} }
TRACE(" found it in watch queue entry %p", q); TRACE(" found it in watch queue entry %p", q);
free_stg_tvar_watch_queue(cap, q); free_stg_tvar_watch_queue(cap, q);
found = TRUE; DEBUG_ONLY( found = TRUE );
break; break;
} }
} }
......
...@@ -715,7 +715,9 @@ schedulePushWork(Capability *cap USED_IF_THREADS, ...@@ -715,7 +715,9 @@ schedulePushWork(Capability *cap USED_IF_THREADS,
if (n_free_caps > 0) { if (n_free_caps > 0) {
StgTSO *prev, *t, *next; StgTSO *prev, *t, *next;
#ifdef SPARK_PUSHING
rtsBool pushed_to_all; rtsBool pushed_to_all;
#endif
debugTrace(DEBUG_sched, debugTrace(DEBUG_sched,
"cap %d: %s and %d free capabilities, sharing...", "cap %d: %s and %d free capabilities, sharing...",
...@@ -725,7 +727,9 @@ schedulePushWork(Capability *cap USED_IF_THREADS, ...@@ -725,7 +727,9 @@ schedulePushWork(Capability *cap USED_IF_THREADS,
n_free_caps); n_free_caps);
i = 0; i = 0;
#ifdef SPARK_PUSHING
pushed_to_all = rtsFalse; pushed_to_all = rtsFalse;
#endif
if (cap->run_queue_hd != END_TSO_QUEUE) { if (cap->run_queue_hd != END_TSO_QUEUE) {
prev = cap->run_queue_hd; prev = cap->run_queue_hd;
...@@ -740,7 +744,9 @@ schedulePushWork(Capability *cap USED_IF_THREADS, ...@@ -740,7 +744,9 @@ schedulePushWork(Capability *cap USED_IF_THREADS,
setTSOPrev(cap, t, prev); setTSOPrev(cap, t, prev);
prev = t; prev = t;
} else if (i == n_free_caps) { } else if (i == n_free_caps) {
#ifdef SPARK_PUSHING
pushed_to_all = rtsTrue; pushed_to_all = rtsTrue;
#endif
i = 0; i = 0;
// keep one for us // keep one for us
setTSOLink(cap, prev, t); setTSOLink(cap, prev, t);
...@@ -1892,7 +1898,7 @@ Capability * ...@@ -1892,7 +1898,7 @@ Capability *
scheduleWaitThread (StgTSO* tso, /*[out]*/HaskellObj* ret, Capability *cap) scheduleWaitThread (StgTSO* tso, /*[out]*/HaskellObj* ret, Capability *cap)
{ {
Task *task; Task *task;
StgThreadID id; DEBUG_ONLY( StgThreadID id );
// We already created/initialised the Task // We already created/initialised the Task
task = cap->running_task; task = cap->running_task;
...@@ -1908,7 +1914,7 @@ scheduleWaitThread (StgTSO* tso, /*[out]*/HaskellObj* ret, Capability *cap) ...@@ -1908,7 +1914,7 @@ scheduleWaitThread (StgTSO* tso, /*[out]*/HaskellObj* ret, Capability *cap)
appendToRunQueue(cap,tso); appendToRunQueue(cap,tso);
id = tso->id; DEBUG_ONLY( id = tso->id );
debugTrace(DEBUG_sched, "new bound thread (%lu)", (unsigned long)id); debugTrace(DEBUG_sched, "new bound thread (%lu)", (unsigned long)id);
cap = schedule(cap,task); cap = schedule(cap,task);
......
...@@ -347,8 +347,8 @@ taskDoneGC (Task *task, Ticks cpu_time, Ticks elapsed_time) ...@@ -347,8 +347,8 @@ taskDoneGC (Task *task, Ticks cpu_time, Ticks elapsed_time)
void void
workerTaskStop (Task *task) workerTaskStop (Task *task)
{ {
OSThreadId id; DEBUG_ONLY( OSThreadId id );
id = osThreadId(); DEBUG_ONLY( id = osThreadId() );
ASSERT(task->id == id); ASSERT(task->id == id);
ASSERT(myTask() == task); ASSERT(myTask() == task);
......
...@@ -194,7 +194,7 @@ void traceOSProcessInfo_ (void); ...@@ -194,7 +194,7 @@ void traceOSProcessInfo_ (void);
#define debugTrace(class, str, ...) /* nothing */ #define debugTrace(class, str, ...) /* nothing */
#define debugTraceCap(class, cap, str, ...) /* nothing */ #define debugTraceCap(class, cap, str, ...) /* nothing */
#define traceThreadStatus(class, tso) /* nothing */ #define traceThreadStatus(class, tso) /* nothing */
#define traceEventStartup_(n_caps) /* nothing */ INLINE_HEADER void traceEventStartup_ (int n_caps STG_UNUSED) {};
#define traceCapsetModify_(tag, capset, other) /* nothing */ #define traceCapsetModify_(tag, capset, other) /* nothing */
#define traceOSProcessInfo_() /* nothing */ #define traceOSProcessInfo_() /* nothing */
...@@ -243,8 +243,9 @@ void dtraceUserMsgWrapper(Capability *cap, char *msg); ...@@ -243,8 +243,9 @@ void dtraceUserMsgWrapper(Capability *cap, char *msg);
HASKELLEVENT_REQUEST_PAR_GC(cap) HASKELLEVENT_REQUEST_PAR_GC(cap)
#define dtraceCreateSparkThread(cap, spark_tid) \ #define dtraceCreateSparkThread(cap, spark_tid) \
HASKELLEVENT_CREATE_SPARK_THREAD(cap, spark_tid) HASKELLEVENT_CREATE_SPARK_THREAD(cap, spark_tid)
#define dtraceStartup(num_caps) \ INLINE_HEADER void dtraceStartup (int n_caps) {
HASKELLEVENT_STARTUP(num_caps) HASKELLEVENT_STARTUP(num_caps)
}
#define dtraceUserMsg(cap, msg) \ #define dtraceUserMsg(cap, msg) \
HASKELLEVENT_USER_MSG(cap, msg) HASKELLEVENT_USER_MSG(cap, msg)
#define dtraceGcIdle(cap) \ #define dtraceGcIdle(cap) \
...@@ -278,7 +279,7 @@ void dtraceUserMsgWrapper(Capability *cap, char *msg); ...@@ -278,7 +279,7 @@ void dtraceUserMsgWrapper(Capability *cap, char *msg);
#define dtraceRequestSeqGc(cap) /* nothing */ #define dtraceRequestSeqGc(cap) /* nothing */
#define dtraceRequestParGc(cap) /* nothing */ #define dtraceRequestParGc(cap) /* nothing */
#define dtraceCreateSparkThread(cap, spark_tid) /* nothing */ #define dtraceCreateSparkThread(cap, spark_tid) /* nothing */
#define dtraceStartup(num_caps) /* nothing */ INLINE_HEADER void dtraceStartup (int n_caps STG_UNUSED) {};
#define dtraceUserMsg(cap, msg) /* nothing */ #define dtraceUserMsg(cap, msg) /* nothing */
#define dtraceGcIdle(cap) /* nothing */ #define dtraceGcIdle(cap) /* nothing */
#define dtraceGcWork(cap) /* nothing */ #define dtraceGcWork(cap) /* nothing */
......
...@@ -177,11 +177,15 @@ GarbageCollect (rtsBool force_major_gc, ...@@ -177,11 +177,15 @@ GarbageCollect (rtsBool force_major_gc,
bdescr *bd; bdescr *bd;
generation *gen; generation *gen;
lnat live_blocks, live_words, allocated, max_copied, avg_copied; lnat live_blocks, live_words, allocated, max_copied, avg_copied;
#if defined(THREADED_RTS)
gc_thread *saved_gct; gc_thread *saved_gct;
#endif
nat g, n; nat g, n;
// necessary if we stole a callee-saves register for gct: // necessary if we stole a callee-saves register for gct:
#if defined(THREADED_RTS)
saved_gct = gct; saved_gct = gct;
#endif
#ifdef PROFILING #ifdef PROFILING
CostCentreStack *prev_CCS; CostCentreStack *prev_CCS;
...@@ -956,7 +960,7 @@ any_work (void) ...@@ -956,7 +960,7 @@ any_work (void)
static void static void
scavenge_until_all_done (void) scavenge_until_all_done (void)
{ {
nat r; DEBUG_ONLY( nat r );
loop: loop:
...@@ -973,8 +977,13 @@ loop: ...@@ -973,8 +977,13 @@ loop:
collect_gct_blocks(); collect_gct_blocks();
// scavenge_loop() only exits when there's no work to do // scavenge_loop() only exits when there's no work to do
#ifdef DEBUG
r = dec_running(); r = dec_running();
#else
dec_running();
#endif
traceEventGcIdle(gct->cap); traceEventGcIdle(gct->cap);
debugTrace(DEBUG_gc, "%d GC threads still running", r); debugTrace(DEBUG_gc, "%d GC threads still running", r);
...@@ -1400,8 +1409,10 @@ mark_root(void *user USED_IF_THREADS, StgClosure **root) ...@@ -1400,8 +1409,10 @@ mark_root(void *user USED_IF_THREADS, StgClosure **root)
// so we need to save and restore it here. NB. only call // so we need to save and restore it here. NB. only call
// mark_root() from the main GC thread, otherwise gct will be // mark_root() from the main GC thread, otherwise gct will be
// incorrect. // incorrect.
#if defined(THREADED_RTS)
gc_thread *saved_gct; gc_thread *saved_gct;
saved_gct = gct; saved_gct = gct;
#endif
SET_GCT(user); SET_GCT(user);
evacuate(root); evacuate(root);
......
...@@ -211,8 +211,8 @@ todo_block_full (nat size, gen_workspace *ws) ...@@ -211,8 +211,8 @@ todo_block_full (nat size, gen_workspace *ws)
// Otherwise, push this block out to the global list. // Otherwise, push this block out to the global list.
else else
{ {
generation *gen; DEBUG_ONLY( generation *gen );
gen = ws->gen; DEBUG_ONLY( gen = ws->gen );
debugTrace(DEBUG_gc, "push todo block %p (%ld words), step %d, todo_q: %ld", debugTrace(DEBUG_gc, "push todo block %p (%ld words), step %d, todo_q: %ld",
bd->start, (unsigned long)(bd->free - bd->u.scan), bd->start, (unsigned long)(bd->free - bd->u.scan),
gen->no, dequeElements(ws->todo_q)); gen->no, dequeElements(ws->todo_q));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment