Richard Guenther wrote:
We do that with -fstrict-aliasing, which also changes language semantics. -fstrict-aliasing is disabled for -O0 and -O1 and enabled for -O[23s].
Yes, and as others have said, this is a bad precedent, and should not be followed further. Inclusion of -fwrapv would be much worse, since this has clearly and precisely defined semantics. In the case of -fno-strict-aliasing, it is more like disabling an optimization, since as far as I know there is no clear semantic meaning for this flag (i.e. a meaning that could be expressed formally at the level of the standard easily).
How do these switches implement your proposal? "All optimiations" sounds like the -fno-wrapv case we have now.
In a couple of ways: First it can include semantics other than wrapping Second, it allows completely unfettered optimization (see password example), which I think no one would want to do by default.
Richard.