Re:“Fiercely resist any further broadening of the scope of t...
by haberman on Thursday April 14, 2016 @04:02PM
(#11499884)
-Ofast turns on optimizations that can break standard-conforming programs!
That is a very different thing that turning on optimizations that might break non-standard-conforming programs!
I think the idea of making it controlled by optimization flags is interesting, but you would need to formalize what the more "safe" variant of the language is if people are actually going to depend on it.
Re:“Fiercely resist any further broadening of the scope of t...
by ktRolster on Thursday April 14, 2016 @06:15PM
(#11500757)
That is a very different thing that turning on optimizations that might break non-standard-conforming programs!
You're talking as though the standard were well-defined. It's not.
Maybe I remembered the history wrong. There are definitely cases of people using -O4 http://www.larcenists.org/Twobit/KVW/kvwbenchmarks.html .
There are definitely optimization options which are (or have been) available that are not turned on by -O3. For example:
-ffast-math
-funroll-all-loops
-fstrict-aliasing
Are not turned on (for good reasons: unrolling loops often slows a program down).
So there's no reason UB optimizations need to be turned on by default, or with -O3. You could throw them in -Ofast or use -Oub, or use optimization specific flags (they should have optimization specific flags in any case) and that was my main point.