"C and C++ Prioritize Performance over Correctness"
https://research.swtch.com/ub
@rsc Wow, that end sentence
@rsc C compiler folks have definitely lost the plot. When I was a gcc maintainer back in 1980s-1990s, the rule was - if your optimization changes a program's result vs nonopt, your optimization is broken. Deleting code because the compiler decides "that can never happen" is the most egregious abuse; the tool author thinks they know better what the end-user programmer wants. The compiler's only real job is turning what the programmer wrote into machine code. Not 2nd guessing it.
@rsc @robpike I seem to recall somewhere in the issue tracker someone proposed an optimization that would lead to incorrect code in some circumstances, and Rob Pike said "I can give you an answer really fast if it's allowed to be wrong" but I can't dig out the issue or the exact quote. Do you remember what it was?
@rsc seems reasonable from the "worse is better" gene it inherited.