[LLVMdev] Debug information and JIT

Eric Christopher echristo at apple.com
Fri Jul 27 10:47:49 PDT 2012


On Jul 27, 2012, at 8:41 AM, Paweł Bylica <chfast at gmail.com> wrote:

> Thanks for suggestion. Unfortunately, I can't check it now as MCJIT
> does not work with my project at the moment.
> 
> I have found a simple example in C that causes the crash:
> 
> int main() {
> 	goto L;
> L:
> 	int a = 0;
> 	return 0;
> }
> 
> What is compiled to:
> 
> define i32 @main() nounwind {
> entry:
>  %retval = alloca i32, align 4
>  %a = alloca i32, align 4
>  store i32 0, i32* %retval
>  br label %L, !dbg !12
> 
> L:                                                ; preds = %entry
>  call void @llvm.dbg.declare(metadata !{i32* %a}, metadata !14), !dbg !15
>  store i32 0, i32* %a, align 4, !dbg !16
>  ret i32 0, !dbg !17
> }
> 
> The problem is with @llvm.dbg.declare which is the first instruction
> of the block.
> I reproduced the crash with lli on win32 and mingw32 but not on linux64.

Probably the easiest thing to do here would be to avoid compiling your module with debug information?

-eric



More information about the llvm-dev mailing list