
It would be useful to have documentation somewhere on what each of the debug flags does. I also can't find a debug flag that prints out the bytecode pretty much as the compiler generates, which is unfortunate. Also -bcodeflatten shows the flattened output, but doesn't include non-conditional jumps, which makes figuring out what is going on impossible.
-bcodeflatten is precisely the bytecode that the compiler outputs ... <from Compile.lhs> pF (sBcodeFlatten flags) "BCode after flattening:" (strBCode (strISBC state) bcode) {- Convert to relative jumps -} bcode <- return (bcRelative bcode) pF (sBcodeRel flags) "BCode after relativising" (strBCode (strISBC state) bcode) {- Write to file -} bcWrite state flags fileflags bcode The only stage after flattening is relativisation, which involves converting for absolute to relative jumps and converting instructions to bytecodes (e.g. PUSH 0 might become 0x42). The reason you won't find unconditional jumps in the flattened output is because flattening removes almost all unconditional jumps (they're usually unnecessary). It is hard to understand though because it's optimized away a lot of normal jump structures, making the flow of control much more subtle. Cheers :-) Tom