3 ms·
I agree that there is a line beyond which you shouldn't expect compilers to optimize. But "being clever" is responsible for lots of seemingly-simple optimizatio
by pcwalton 10y ago
I agree that there is a line beyond which you shouldn't expect compilers to optimize. But "being clever" is responsible for lots of seemingly-simple optimizations. If you want something to blame, blame the C language for making program transformations hard due to unrestricted aliasing and so forth. Don't blame compiler authors for responding to the demands of their users.
- galacticpony 10y agoMany users don't want "clever" optimizations and compiler authors often implement things that nobody would ever ask for, because it has no real-world benefit. See: https://www.theregister.co.uk/2015/11/01/linus_torvalds_fires_off_angry_compilermasturbation_rant/ https://www.theregister.co.uk/2015/11/01/linus_torvalds_fire... If we had an hour to discuss which optimizations are or are not "clever" in the derogatory sense, maybe we would agree on almost everything. Alas, I've spent enough time on this thread. Good day!