diff options
author | Ian Lynagh <igloo@earth.li> | 2011-06-24 20:51:13 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2011-06-25 19:16:32 +0100 |
commit | 0a6f26f6d29c8762b254e2f1040fce5c3571feea (patch) | |
tree | 6706444dab64cb0c2d6143ecb17db0e9ca2fc0cd /rts/Interpreter.c | |
parent | 12b93887fd8b6a185b1bff994c865c897d22a6a6 (diff) | |
download | haskell-0a6f26f6d29c8762b254e2f1040fce5c3571feea.tar.gz |
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.
Diffstat (limited to 'rts/Interpreter.c')
-rw-r--r-- | rts/Interpreter.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/rts/Interpreter.c b/rts/Interpreter.c index ade4ad18ed..37e0e051c4 100644 --- a/rts/Interpreter.c +++ b/rts/Interpreter.c @@ -49,13 +49,21 @@ /* Sp points to the lowest live word on the stack. */ -#define BCO_NEXT instrs[bciPtr++] -#define BCO_NEXT_32 (bciPtr += 2, (((StgWord) instrs[bciPtr-2]) << 16) + ((StgWord) instrs[bciPtr-1])) -#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_NEXT instrs[bciPtr++] +#define BCO_NEXT_32 (bciPtr += 2) +#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 #define BCO_NEXT_WORD BCO_NEXT_32 +#define BCO_READ_NEXT_WORD BCO_READ_NEXT_32 #elif WORD_SIZE_IN_BITS == 64 #define BCO_NEXT_WORD BCO_NEXT_64 +#define BCO_READ_NEXT_WORD BCO_READ_NEXT_64 #else #error Cannot cope with WORD_SIZE_IN_BITS being nether 32 nor 64 #endif @@ -776,8 +784,12 @@ run_BCO: register StgWord16* instrs = (StgWord16*)(bco->instrs->payload); register StgWord* literals = (StgWord*)(&bco->literals->payload[0]); register StgPtr* ptrs = (StgPtr*)(&bco->ptrs->payload[0]); +#ifdef DEBUG int bcoSize; - bcoSize = BCO_NEXT_WORD; + bcoSize = BCO_READ_NEXT_WORD; +#else + BCO_NEXT_WORD; +#endif IF_DEBUG(interpreter,debugBelch("bcoSize = %d\n", bcoSize)); #ifdef INTERP_STATS |