[cfe-dev] Feature request: C intrinsics for overflow detection

Reid Kleckner rnk at google.com
Fri May 9 10:55:54 PDT 2014


They are exposed:
http://clang.llvm.org/docs/LanguageExtensions.html#checked-arithmetic-builtins

... but that's not indexed by Google.  Maybe this is the problem?
http://clang.llvm.org/robots.txt:
User-agent: *
Disallow:


On Fri, May 9, 2014 at 10:27 AM, Andy Lutomirski <luto at amacapital.net>wrote:

> LLVM has the llvm.*.with.overflow.* intrinsics.  Can these be exposed
> to C code?  I imagine this would be straightforward, aside from the
> obligatory bikeshedding about exactly what the interface should be.
>
> This would eliminate a lot of nasty hacks used to check for overflow,
> especially for multiplication overflow.  I currently write this stuff
> in inline x86 assembler -- ugh!  And maybe gcc would go along if clang
> paved the way :)
>
> --Andy
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140509/54729712/attachment.html>


More information about the cfe-dev mailing list