Might a -native-semantics switch, forcing native target optimization semantics, be reasonable?
Paul Schlie
schlie@comcast.net
Mon Jan 2 16:48:00 GMT 2006
> From: Robert Dewar <dewar@adacore.com>
> .. there is no requirement that optimization preserve the behavior of
> undefined programs ... It is fine to argue that defining the semantics
> is useful in a particular case, but arguing solely from the point of
> view of trying to preserve observed behaviort is a poor argument.
>
> Indeed the point is that optimization is not changing the behavior, the
> behavior is non-deterministic, and can change from one compilation to
> the next even if optimization does not change.
- observable program behavior is the only thing that's significant.
- yes, it's understood that a language's specification may consider
multiple program implementations having differing observable behaviors
as being logically equivalent when their observable differences are
restricted to differing implementations of under/undefined language
semantics; however this does not imply observable behavior modifying
optimizations are generally innocuous and/or desirable, as in fact any
optimization which may alter a programs observable behavior which was
otherwise deemed desirable is clearly arguably counterproductive, as
neither observable behavior is warranted to be portable or more correct.
- however as promised I'll abstain from further debate as the community
seems satisfied with accepting the consequences of such optimizations.
More information about the Gcc
mailing list