4 ms·
Signed integer overflow is undefined in C, so optimizers can do really weird things to code that has overflows.
by nitrogen 13y ago
Signed integer overflow is undefined in C, so optimizers can do really weird things to code that has overflows.
- anaphor 13y agoYes, see: http://people.csail.mit.edu/nickolai/papers/wang-undef.pdf http://people.csail.mit.edu/nickolai/papers/wang-undef.pdf
- kps 13y agoAnd see John Regehr's ( http://blog.regehr.org/ http://blog.regehr.org/, of the headline article) other posts. He's written a great deal about undefined behaviour in C/C++ and how modern compilers handle it. Check the ‘Compilers’ and ‘Software Correctness’ categories.