Commit 187192a6 authored by Daniel Gröber (dxld)'s avatar Daniel Gröber (dxld)

rts: RetainerProfile.c: Re-enable and fix warnings

Turns out some genius disabled warnings for RetainerProfile.c in the build
system. That would have been good to know about five silent type mismatch
crashes ago.. :)
parent 96adf179
...@@ -276,7 +276,7 @@ rtsPackageArgs = package rts ? do ...@@ -276,7 +276,7 @@ rtsPackageArgs = package rts ? do
, inputs ["**/Compact.c"] ? arg "-Wno-inline" , inputs ["**/Compact.c"] ? arg "-Wno-inline"
-- emits warnings about call-clobbered registers on x86_64 -- emits warnings about call-clobbered registers on x86_64
, inputs [ "**/RetainerProfile.c", "**/StgCRun.c" , inputs [ "**/StgCRun.c"
, "**/win32/ConsoleHandler.c", "**/win32/ThrIOManager.c"] ? arg "-w" , "**/win32/ConsoleHandler.c", "**/win32/ThrIOManager.c"] ? arg "-w"
-- The above warning suppression flags are a temporary kludge. -- The above warning suppression flags are a temporary kludge.
-- While working on this module you are encouraged to remove it and fix -- While working on this module you are encouraged to remove it and fix
......
...@@ -363,6 +363,8 @@ find_srt( stackPos *info ) ...@@ -363,6 +363,8 @@ find_srt( stackPos *info )
info->next.srt.srt = NULL; info->next.srt.srt = NULL;
return c; return c;
} }
return NULL;
} }
/** /**
...@@ -449,7 +451,6 @@ STATIC_INLINE void ...@@ -449,7 +451,6 @@ STATIC_INLINE void
traversePushChildren(traverseState *ts, StgClosure *c, stackData data, StgClosure **first_child) traversePushChildren(traverseState *ts, StgClosure *c, stackData data, StgClosure **first_child)
{ {
stackElement se; stackElement se;
bdescr *nbd; // Next Block Descriptor
debug("traversePushChildren(): stackTop = 0x%x\n", ts->stackTop); debug("traversePushChildren(): stackTop = 0x%x\n", ts->stackTop);
...@@ -606,6 +607,7 @@ traversePushChildren(traverseState *ts, StgClosure *c, stackData data, StgClosur ...@@ -606,6 +607,7 @@ traversePushChildren(traverseState *ts, StgClosure *c, stackData data, StgClosur
// SRT only // SRT only
case THUNK_STATIC: case THUNK_STATIC:
ASSERT(get_itbl(c)->srt != 0); ASSERT(get_itbl(c)->srt != 0);
/* fall-thru */
case THUNK_0_1: case THUNK_0_1:
case THUNK_0_2: case THUNK_0_2:
thunk_srt_only: thunk_srt_only:
...@@ -985,7 +987,7 @@ traverseMaybeInitClosureData(StgClosure *c) ...@@ -985,7 +987,7 @@ traverseMaybeInitClosureData(StgClosure *c)
* that decision is lost in time. * that decision is lost in time.
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
STATIC_INLINE bool STATIC_INLINE bool
isRetainer( StgClosure *c ) isRetainer( const StgClosure *c )
{ {
switch (get_itbl(c)->type) { switch (get_itbl(c)->type) {
// //
...@@ -1192,7 +1194,6 @@ static void ...@@ -1192,7 +1194,6 @@ static void
traversePushStack(traverseState *ts, StgClosure *cp, stackData data, traversePushStack(traverseState *ts, StgClosure *cp, stackData data,
StgPtr stackStart, StgPtr stackEnd) StgPtr stackStart, StgPtr stackEnd)
{ {
stackElement *oldStackBoundary;
StgPtr p; StgPtr p;
const StgRetInfoTable *info; const StgRetInfoTable *info;
StgWord bitmap; StgWord bitmap;
...@@ -1335,8 +1336,10 @@ traversePAP (traverseState *ts, ...@@ -1335,8 +1336,10 @@ traversePAP (traverseState *ts,
} }
static bool static bool
retainVisitClosure( const StgClosure *c, const StgClosure *cp, const stackData data, const bool first_visit, stackData *out_data ) retainVisitClosure( StgClosure *c, const StgClosure *cp, const stackData data, const bool first_visit, stackData *out_data )
{ {
(void) first_visit;
retainer r = data.c_child_r; retainer r = data.c_child_r;
RetainerSet *s, *retainerSetOfc; RetainerSet *s, *retainerSetOfc;
retainerSetOfc = retainerSetOf(c); retainerSetOfc = retainerSetOf(c);
...@@ -1525,9 +1528,10 @@ inner_loop: ...@@ -1525,9 +1528,10 @@ inner_loop:
// reachable static objects. // reachable static objects.
goto loop; goto loop;
} }
/* fall-thru */
case FUN_STATIC: { case FUN_STATIC: {
StgInfoTable *info = get_itbl(c); const StgInfoTable *info = get_itbl(c);
if (info->srt == 0 && info->layout.payload.ptrs == 0) { if (info->srt == 0 && info->layout.payload.ptrs == 0) {
goto loop; goto loop;
} else { } else {
...@@ -1657,8 +1661,6 @@ computeRetainerSet( traverseState *ts ) ...@@ -1657,8 +1661,6 @@ computeRetainerSet( traverseState *ts )
{ {
StgWeak *weak; StgWeak *weak;
uint32_t g, n; uint32_t g, n;
StgPtr ml;
bdescr *bd;
markCapabilities(retainRoot, (void*)ts); // for scheduler roots markCapabilities(retainRoot, (void*)ts); // for scheduler roots
...@@ -1745,8 +1747,8 @@ resetStaticObjectForProfiling( StgClosure *static_objects ) ...@@ -1745,8 +1747,8 @@ resetStaticObjectForProfiling( StgClosure *static_objects )
p = (StgClosure*)*STATIC_LINK(get_itbl(p), p); p = (StgClosure*)*STATIC_LINK(get_itbl(p), p);
break; break;
default: default:
barf("resetStaticObjectForProfiling: %p (%s)", barf("resetStaticObjectForProfiling: %p (%lu)",
p, get_itbl(p)->type); p, (unsigned long)get_itbl(p)->type);
break; break;
} }
} }
......
...@@ -95,7 +95,7 @@ typedef struct traverseState_ { ...@@ -95,7 +95,7 @@ typedef struct traverseState_ {
* once you can simply return 'first_visit'. * once you can simply return 'first_visit'.
*/ */
typedef bool (*visitClosure_cb) ( typedef bool (*visitClosure_cb) (
const StgClosure *c, StgClosure *c,
const StgClosure *cp, const StgClosure *cp,
const stackData data, const stackData data,
const bool first_visit, const bool first_visit,
......
...@@ -504,7 +504,6 @@ rts/sm/Compact_CC_OPTS += -Wno-inline ...@@ -504,7 +504,6 @@ rts/sm/Compact_CC_OPTS += -Wno-inline
# emits warnings about call-clobbered registers on x86_64 # emits warnings about call-clobbered registers on x86_64
rts/StgCRun_CC_OPTS += -w rts/StgCRun_CC_OPTS += -w
rts/RetainerProfile_CC_OPTS += -w
# On Windows: # On Windows:
rts/win32/ConsoleHandler_CC_OPTS += -w rts/win32/ConsoleHandler_CC_OPTS += -w
rts/win32/ThrIOManager_CC_OPTS += -w rts/win32/ThrIOManager_CC_OPTS += -w
......
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