> Robert wrote: >> Paul Schlie wrote: >> Upon attempted careful reading of the standard's excerpts quoted by >> Gabriel Dos Reis per <http://gcc.gnu.org/ml/gcc/2006-12/msg00763.html>, >> it's not clear that GCC's current presumption of LIA-1 overflow semantics >> in absents of their true support is actually advocated by the standard. >> >> As by my read, it seems fairly clear that "If an implementation adds >> support for the LIA-1 exception values ... then those types are LIA-1 >> conformant types"; > > You are reaching here, based on your peculiar notion of the relevance > of behavior of some target instructions to language semantics. But > there is no such relation. The C standard creates a semantic model > that is entirely independent of the target architecture with respect > to the overflow issue. The behavior of instructions on the machine > has nothing to do with what a compiler must implement.
- Yes it's a stretch, however although it's agreed there's no intrinsic relationship between a language's semantics and a particular target machine's instruction set; the compiler in effect defines one, which arguably should ideally be consistently preserved, as attempting to leverage behaviors factually not present in the compiler's originally chosen mappings, may worst case silently alter the originally expressed behavior of the resulting program to likely no one's benefit, presuming the original behavior as defined by the compiler was in fact desired, although both considered legitimate. >> implies to me an intent that LIA-1 semantics may be >> legitimately presumed "if" the semantics are "supported" by a target >> implementation > > It may (and apparently does) imply this to you, but there is > absolutely no implication of this in the standard. if the standard > wanted to say this, it would (although it would be VERY difficult > to state this in meaningful normative form). - Correspondingly, if the standard didn't intend to clarify LIA-1 conforming support within the scope of undefined signed overflow semantics, it need not have "said" anything; thereby seemingly considered an implementation's optional "support" of LIA-1 to be worth noting, and predicated on its "support" (which most targets simply inherently don't). >> (just as null pointer optimizations should not be >> considered legitimate if not correspondingly literally supported by >> a given target). > > There is no such implication in the standard. either - Only by analogy to above. > You persist in this strange notion of "factual support" of the > "target", but there is nothing to support this notion in either > the standard > > There is reasonable grounds for arguing for limiting the > effects of this particular undefined optimization, but you > can not find any support for this in the standard itself > at all. - Agreed.