[LLVMdev] Integer divide by zero

Cameron McInally cameron.mcinally at nyu.edu
Fri Apr 5 14:26:20 PDT 2013


On Fri, Apr 5, 2013 at 5:06 PM, Owen Anderson <resistor at mac.com> wrote:
...

> Clang's -fsanitize=integer-divide-by-zero option seems to provide what you
> want.  See the Clang User Manual:
> http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
>
>
That looks pretty close. I assume there are performance penalties for the
runtime checks?

I would really like to produce the actual sdiv/udiv instruction and allow
the processor to fault on it. That seems like the right fix to me.

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


More information about the llvm-dev mailing list