Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Except for the fact that performance optimization frequently does change the behaviour of the program.


That 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).


I'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.


If performance optimization changes anything other than performance it's either a bug in the program or a bug in the compiler.


Yes, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: