[llvm-dev] Dynamic detection of signed integer overflow

mats petersson via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 15 01:56:20 PDT 2015


On 15 September 2015 at 09:48, John Regehr via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Thanks John, seems like a dynamic runtime instrumentation is then not a
>> good idea. I had a look at the UBSan features in Clang and I might be able
>> to use them instead. But it seems like that vector operations are not
>> instrumented with overflow checks if I specify the option
>> -fsanitize=signed-integer-overflow. Am I missing some other option or is
>> there a special reason why vector operations are not checked?
>>
>
> I might be misunderstanding you, and I haven't looked at this code lately,
> but the goal of UBSan is to check C's rules for integer UBs.  Since C does
> not have vectors, I'm not sure exactly what you are expecting here.  Could
> you give a bit more detail?


OpenCL as a language is a modified C99, which does have, amongst a few
other things, support for vector types for basic types (char, short, int,
long and their unsigned variants as well as floating point types half,
float and double).

So, there is probably some work required to implement this for OpenCL's
native vector support. I haven't looked at the code, so can't say if
there's any particular difficulty in this particular case.

--
Mats

>
>
> John
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150915/a4dcadfb/attachment.html>


More information about the llvm-dev mailing list