-finfo-table-map is broken in wasm NCG
The decodeMyStack test case fails with wasm NCG with incorrect output:
StackEntry {functionName = "", moduleName = "Main", srcLoc = ":", closureType = 53}
StackEntry {functionName = "", moduleName = "Main", srcLoc = ":", closureType = 53}
StackEntry {functionName = "", moduleName = "Main", srcLoc = ":", closureType = 53}
The correct output (which the wasm unreg codegen gets right):
StackEntry {functionName = "main.(...)", moduleName = "Main", srcLoc = "decodeMyStack.hs:22:27-40", closureType = 53}
StackEntry {functionName = "getDeepStack.getDeepStackCase", moduleName = "Main", srcLoc = "decodeMyStack.hs:18:26-28", closureType = 53}
StackEntry {functionName = "getDeepStack.getDeepStackCase", moduleName = "Main", srcLoc = "decodeMyStack.hs:13:7-21", closureType = 53}
The offending object file is decodeMyStack.o (before merging with the stub object). Disassembling that file reveals that they differ in a big .rodata section that seems to encode some source location info. The NCG version has less bytes and seem to have dropped some info that's present in the unreg version.
Marking this as a normal priority bug since -finfo-table-map isn't commonly used yet. Though I'm still mildly curious what exactly went wrong in the NCG pipeline that caused this bug..
Edited by Cheng Shao