[llvm-commits] [llvm] r131887 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineMulDivRem.cpp test/Transforms/InstCombine/shift.ll

Duncan Sands baldrick at free.fr
Tue May 24 09:45:09 PDT 2011


Hi Dan,

>>> Dividing by zero actually generates a trap, not just undef. You could update the
>>> LangRef to make that explicit.
>>
>> indeed this was my objection: according to the LangRef div by zero does not
>> generate a trap value.  If it's just a doc bug (Dan, can you please confirm)
>> then I will fix LangRef.
>
>
> Where in LangRef are you referring to?  In the descriptions of sdiv and udiv, it
> says that division by zero is whole-watermelon undefined behavior.

indeed "Division by zero leads to undefined behavior" - yup, that sounds like
it could make water-melons fly out of your nose :)

Thanks, Duncan.



More information about the llvm-commits mailing list