[LLVMdev] Integer divide by zero

Cameron McInally cameron.mcinally at nyu.edu
Mon Apr 8 11:37:37 PDT 2013


On Mon, Apr 8, 2013 at 2:07 PM, Cameron McInally
<cameron.mcinally at nyu.edu>wrote:
...

>
> *** IR Dump Before Deduce function attributes ***
> define i32 @main() #0 {
> entry:
>   call void @__ubsan_handle_divrem_overflow(i8* bitcast ({ { i8*, i32, i32
> }, { i16, i16, [6 x i8] }* }* @2 to i8*), i64 6, i64 0) #3
>   %call1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([9 x
> i8]* @.str, i64 0, i64 0), i32 undef) #3
>   ret i32 0
> }
>

On second thought, I do see the idiv operands. So that will work!

I suppose I just have to disambiguate between div and mod for this to be
complete. That could be done at my interface.

Thanks for the help, guys.

-Cameron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130408/9cf278f4/attachment.html>


More information about the llvm-dev mailing list