5 ms·
Except for the fact that performance optimization frequently does change the behaviour of the program.
by glitchc 2y ago
Except for the fact that performance optimization frequently does change the behaviour of the program.
- mrob 2y agoIf performance optimization changes anything other than performance it's either a bug in the program or a bug in the compiler.
- naasking 2y agoYes, but program bugs are obviously very, very common. Developers already do a great job of adding bugs to their programs, they don't need compilers compounding that problem in non-deterministic ways.
- rocqua 2y agoThat is only possible if the optimization is wrong (rare), or the program already had undefined behavior (very common, because undefined behavior is very easy to trigger in C).
- glitchc 2y agoI'll give an example: -ffast-math. There's extensive literature out there on how fast-math changes the behaviour of code. I've been bitten by this a couple of times already.