News for hackers. Stuff that matters.
Re:A bit of background on compilers exploiting signed overflow by nkurz on Sunday May 08, 2016 @07:29PM (#11656541)
Can assert() actually function this way? Can you use assert to tell the optimizer it can assume something is true?

Yes, but it would have the potentially surprising behavior that compiling your release version with -DNDEBUG might slow it down. We ran into this a couple years ago: https://plus.google.com/+DanielLemirePhD/posts/BTSams19Ero

Recent compilers support some extensions that can do it better. GCC and CLang use __builtin_assume_aligned(), and ICC uses __assume_aligned() (haven't tested the synonym).

There are no comments on this comment yet.