[LLVMdev] Debug information and JIT

Paweł Bylica chfast at gmail.com
Fri Jul 27 08:41:56 PDT 2012


On Thu, Jul 26, 2012 at 5:25 PM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Paweł,
>> I have a problem that was reported some time ago but never received
>> any solution.
>
> probably the reason that there is no action is surely that the old JIT
> implementation is being replaced with the new MCJIT implementation, so
> no-one feels very motivated to fix the old JIT since it is going away.
> Try passing -use-mcjit to lli.
>
> Ciao, Duncan.

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.

>
>> See
>> http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-November/036113.html
>> http://llvm.org/bugs/show_bug.cgi?id=6981
>>
>> JIT emitter for X86 aborts when is asked to emit instruction for
>> opcode 11 (DBG_VALUE).
>> That opcode comes from @llvm.dbg.declare intrinsic function.
>>
>> Should this intrinsic be removed in some earlier stage?
>>
>> --
>> Paweł Bylica
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list