Dec 01, 2016

> this describes compilers for all modern languages

Yes, this is the current trend. And the results don't really justify the cost:

Which is why I (roughly) agree with Daniel Bernstein's polemic "The Death of Optimizing Compilers"

(I frequently make code 10x to 1000x or more faster, and compilers' contributions to that total tend to be fairly minimal, though larger than zero and usually worthwhile. But not worth the current shenanigans and not worth having no idea how the code is going to turn out)

Oct 05, 2016

Common misconception, see Proebsting's Law, "The Death of Optimizing Compilers":

as well as 'What every compiler writer should know about programmers or “Optimization” based on undefined behaviour hurts performance '

Sep 26, 2016

More than with Swift. I routinely see 100x - 1000x and more performance difference between -O0 and -O in Swift. Considering that the optimiser doesn't give warnings or errors if it can't apply optimisations, that's out of bounds for me for a systems programming language. YMMV.

The whole UB idiocy is a different matter, though related because it's perpetrated by roughly the same group of people, for similar nonsensical and non-validated reasons. See my post

See also: and Proebsting's Law.

Apr 09, 2016

Examples you listed would be better made "implementation defined." ie use RFC language with "Programmers should avoid shifting by more than the bitwidth, compilers should produce an implementation defined result, but may specify a trap in this circumstance"

What's your opinion of What every compiler writer should know about programmers?

Mar 08, 2016

> This is one of the reasons gcc/llvm won: they don't care about that stuff. I mean, they care about performance, but not at all costs like these guys care.


While GCC and LLVM do care about implementing the standard correctly, they show little mercy to the poor developer who failed to avoid one of the many sharp corners of undefined behaviour.