comp.lang.ada
 help / color / mirror / Atom feed
From: tpmsph@ecsvax.UUCP (Thomas P. Morris)
Subject: Re: optimizating compilers (VMS ADA)
Date: 22 Jan 88 04:11:20 GMT	[thread overview]
Message-ID: <4464@ecsvax.UUCP> (raw)
In-Reply-To: 8801201714.AA15107@ajpo.sei.cmu.edu

In article <8801201714.AA15107@ajpo.sei.cmu.edu>, TENE@TECHMAX.BITNET writes:
> In reply to Norman Cohen:
>             ... These examples should have been erroneous (I am not sure
> they can be classified as errors since it would be hard to detect them
> at compilation time) but even when they are not erroneous they are
> bad-programming.

	I don't believe the code in the original example was erroneous.
Where in the LRM does it classify the actions of that code as erroneous?
If anything, the compiler's optimization ought to be considered erroneous,
tenously in violation of LRM 3.2.1.6-8 (object elaboration rules), in that
the "initial value" obtained by evaluation of the explicit initialization
should be the CONTENTS of the STRING pointed to, not the ADDRESS of the
STRING pointed to. Yes, I know that most compilers and runtimes consider
a string and its address as one and the same thing. But compile-time semantic
checks should not do so. Structure-sharing between the physical storage occupied
by a constant and a variable must be erroneous, although there is no 
explicit statement in the LRM to that effect.

> I understand and passively support the "strict constructionist" attitude.
> I agree that ADA (which started out this way) could (and maybe should)
> have gone all the way and defined a strict language semantics.
> Mathematical rigor in the design of programming languages, probably would
> increase the number of truly safe and legal optimizations which would
> then make the need for unsafe optimization less critical.
> 
     Definition of strict language sematics would certainly have helped
greatly in this case. As above, if strict semantics had been defined, it
would have been quite clear that the compiler ought not to share storage
occupied by a variable (A.all) and a constant.

Tom Morris

  parent reply	other threads:[~1988-01-22  4:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1988-01-20 16:06 optimizating compilers (VMS ADA) TENE
1988-01-21 21:18 ` Dennis Doubleday
1988-01-21 21:18 ` Erland Sommarskog
1988-01-22  4:11 ` Thomas P. Morris [this message]
1988-01-28 23:49 ` Dave Seward
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox