Optimization-unstable code
Optimization-unstable code
Posted Dec 6, 2013 1:40 UTC (Fri) by dashesy (guest, #74652)In reply to: Optimization-unstable code by mti
Parent article: Optimization-unstable code
A compiler flag to warn, any time compiler optimizes something assuming that alternative is undefined would be helpful too. Right now compilers are actually more than happy if I accidentally trigger one of these undefined behaviors, because they could just simplify the whole thing to equivalent of return 0; and make a code that is much faster although unexpected, thus useless.
As long as compiler writers are concerned, their paycheck depends on how faster (or smaller) the compiled binary is, while mine requires the binary to work first. The concept of correctness depends on the perspective I guess.