On Wed, Jul 23, 2014 at 04:56:06PM +0200, Thomas Mertes wrote: > A sanitizer such as ubsan is good as tool to find errors in C > programs. But I don't think that ubsan is well suited to do overflow > detection with maximum performance. Is just not the goal of this > tool.
That's true. But if you only use -fsanitize=signed-integer-overflow, then the overhead shouldn't be that bad, especially on x86_64 where we try to make use of jo (jump if overflow) instruction. Perhaps use that option together with -fsanitize-undefined-trap-on-error, so it doesn't call libubsan routines at all. Marek