comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Handling Addressing Errors
Date: 1999/03/20
Date: 1999-03-20T00:00:00+00:00	[thread overview]
Message-ID: <F8vDt3.6sH.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 36F21863.7D71@iki.fi

Mikko Levanto (mikko.levanto@iki.fi) wrote:
: Tucker Taft wrote:

: > This is made explicit in RM95 C.6(20) and 1.1.3(13), which indicates
: > that the "external effect" of a program includes *each*
: > read and update of a volatile or atomic object.
: > It is illegal to optimize away an external effect (RM95 1.1.3(15)).

: Can optimization affect the number of accesses ?

No.  A correct optimization may not change the number of reads or writes.

: E.g., if A is volatile, does

:    A := A + A;

: always cause two reads and one write?

Yes.  Each read and update is an external effect, and an optimization
may not add or remove required external effects.

An example of an external effect is printing the digit "2".
It would obviously be wrong for an optimization to change output
from "1223" to "123" simply because there were 2 "2"s in a row.
The same applies to reads of a volatile object.

: -- 
: Mikko J. Levanto
: mailto:mikko.levanto@vtt.fi

--
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




  parent reply	other threads:[~1999-03-20  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-03  0:00 Handling Addressing Errors Charles H. Sampson
1999-03-04  0:00 ` Nick Roberts
1999-03-04  0:00 ` robert_dewar
1999-03-18  0:00   ` Charles H. Sampson
1999-03-18  0:00     ` Nick Roberts
1999-03-21  0:00       ` robert_dewar
1999-03-18  0:00     ` Tucker Taft
1999-03-19  0:00       ` Mikko Levanto
1999-03-19  0:00         ` Nick Roberts
1999-03-20  0:00         ` Tucker Taft [this message]
1999-04-02  0:00       ` Charles H. Sampson
1999-03-19  0:00     ` robert_dewar
replies disabled

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