4 ms·
You don't think it could possibly surprise anyone that changing optimization level can change the meaning of the program?
by monochromatic 14y ago
You don't think it could possibly surprise anyone that changing optimization level can change the meaning of the program?
- acqq 14y agoWhen you turn on FP optimizations you say to the compiler "sacrifice some bits here and there, give me more speed." I don't know any manual that explains such options and doesn't make that clear. Counterexamples welcome here too.
- monochromatic 14y agoI'm not saying you're wrong about what it does, or even about whether it's documented. I'm saying that most compiler optimizations don't behave that way, and I can certainly see this being a surprise to someone who views optimizations generally as correctness-preserving transformations.
- scott_s 14y agoBecause people may not realize that such things are possible, they may not realize that, say, -ffast-math in gcc is dangerous. Yes, the man page says it right there, but that assumes you know what that means.