4 ms·
From GCC documentation, >The compiler will attempt to use hardware instructions to implement these built-in functions where possible, like conditional jump on
by jojobas 6y ago
From GCC documentation,
>The compiler will attempt to use hardware instructions to implement these built-in functions where possible, like conditional jump on overflow after addition, conditional jump on carry etc.
I suspect something's not exactly right with compiler flags.
Then again, how much of your program is integer arithmetic?
12x slowdown on 0.1% is 1.2%.
- Deukhoofd 6y agoIt appears GCC doesn't call the builtin overflow functions with that flag on however.
- Gibbon1 6y agoWhat I find annoying is we go back and forth over this because the insistence on clinging to the one true holy int type as on Gods Blessed Machine the PDP 11. Instead of implementing proper variable types like you have with Ada. Seriously considering code can compiled for on 16, 32, and 64 bit machines 'int' is dodgy as hell.
- formerly_proven 6y agoI love typedefs for u8, u16, u32 and their signed brethren, because it's just as short as "int" but way more sane.
- gpderetta 6y agoIIRC -ftrap is basically unmaintained in GCC and you are supposed to use ubsan instead. edit: and it seems that ubsan does generate a simple jo: https://godbolt.org/z/88dE5G Don't use -ftrap I guess.