simont |
Mon 2014-01-27 22:05 |
and I shall link to your article from it, if you don't mind.
Of course; feel free!
and LOOK! The compiler did better than you did!
Heh, yes :-) Though on the other hand my general experience is that it is usually possible to find something the compiler could have done better – provided you have the compiler's own output to start from and try to improve on. I don't doubt that starting from scratch it's much harder to beat the compiler, though...
"... and actually the compiler isn't very clever at all" (for example with your overflow / undefined behaviour example)
I think the problem there isn't that the compiler is not clever, it's that it has great cleverness which it's misapplying. The fact that some apparently perfectly sensible piece of code that people might reasonably want to write constitutes undefined behaviour by chapter and verse of the C standard is being taken by the compiler developers to mean "and therefore we can do whatever we like", where it ought to be being taken to mean "and therefore chapter and verse of the C standard is not the sole metric of sensible compiler behaviour"! |
|