This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Might a -native-semantics switch, forcing native target optimization semantics, be reasonable?
- From: Paul Schlie <schlie at comcast dot net>
- To: Robert Dewar <dewar at adacore dot com>
- Cc: Gabriel Dos Reis <gdr at integrable-solutions dot net>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Mon, 02 Jan 2006 11:47:55 -0500
- Subject: Re: Might a -native-semantics switch, forcing native target optimization semantics, be reasonable?
> 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.