News for hackers. Stuff that matters.
Re:Fast integer overflow detection (2012) by Moral_ on Sunday December 14, 2014 @03:53PM (#8749520)
In gcc there are some pragmas you can use to to this:

for instance `#pragma gcc optimize("O0")` should work.

https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Function-Specif...

But the whole "this code might be removed during optimization" isn't exactly true. The compiler has to keep the meaning of your code the same. But once you introduce undefined behavior into the code, everything is meaningless from then on and gcc can do tons of wacky stuff.

There are no comments on this comment yet.