4 ms·
If some code does not work as expected, the compiler is broken. Sacrificing correctness for speed is an unfortunate trend. I have written lots of compilers in
by nils-m-holm 7y ago
If some code does not work as expected, the compiler is broken.
Sacrificing correctness for speed is an unfortunate trend. I have written lots of compilers in my life, both toys and "real-world" ones, and I can say with certainty that more than 90% of the bugs appear in the optimizer. Without formal verification or at least very exhaustive testing, optimizations should not be included in compilers. Of course, this is very hard to accomplish in low-level languages.
- viraptor 7y ago> does not work as expected Is this meaningful? Lots of behaviour is logically unexpected by developers, but well described in the standard and implemented correctly in the compiler. If the language gives unexpected results, that's closer to the specification problem than a compiler issue.
- pjmlp 7y agoThe compiler is only broken if the developer took into account the respective language reference, and the compiler fails stardard certification tests.
- CJefferson 7y agoThe problem is, as far as I know, no languages make any promises about values left in physical memory or enforcing code take constant time. Security code cares about these things, so has to make use of a best effort, and checking assembly.