Sample code: http://pastebin.com/fL1yTVCk Compilation: gcc fail.c -m64 `/Users/amaury/d/llvm/build/Debug+Asserts/bin/llvm-config --cflags` `/Users/amaury/d/llvm/build/Debug+Asserts/bin/llvm-config --ldflags` `/Users/amaury/d/llvm/build/Debug+Asserts/bin/llvm-config --libs` -lc++ -lncurses -lz $ ./a.out ; ModuleID = 'm1' ; ModuleID = 'm2' define i32 @foo() { ret i32 42 } Bus error: 10 Further exploration showed me that the failure happen when calling the Jitted function. It look like the generated code is invalid.
Reproduced locally. I'll investigate shortly.
Hi deadalnix, As discussed on IRC, I think this was due to an iterator invalidation bug in MCJIT. I've fixed that issue in r217291. Could you check that out and see if it fixes your issue? Cheers, Lang.
It looks good, closing, and thank you !