This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C as intermediate language, signed integer overflow and -ftrapv


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]