Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
pbsd
on Dec 18, 2014
|
parent
|
context
|
favorite
| on:
The Performance Cost of Integer Overflow Checking
GCC 4.9 does have `-fsanitize=signed-integer-overflow`, and it generates pretty good code for that toy function:
f(int, int): mov eax, edi add eax, esi jo .L8 ret .L8: ...
Marat_Dukhan
on Dec 18, 2014
[–]
Older gcc versions have `-ftrapv` option, which checks overflow for signed addition, subtraction, and multiplication. However, the implementation calls libgcc functions to do the checks, resulting in non-negligible overhead.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: