comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Unreferenced lock variables
Date: 1999/04/19
Date: 1999-04-19T00:00:00+00:00	[thread overview]
Message-ID: <FAEwxu.Lps.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 3717b010.18059463@news.pacbell.net

Tom Moran (tmoran@bix.com) wrote:

: >permission
: >to remove an Initialize/Finalize pair only if there is an assignment

: Ah, so the complete removal of the (seemingly) unused control type
: declaration is a consequence of being able to optimize the case where
: it is in fact used (later)? 
: > Initialize(X);
: >     ...
: >    Finalize(X)
: >    <copy Y to X>
: What happens if the Initialize or Finalize of X, (which will be
: optimized away) modifies Y?  Or is that illegal?

It is certainly not "illegal," but if this rule is adopted, it would
probably be unwise ;-).  

The point of rules like this is to allow controlled objects to be treated 
largely like "normal" variables w.r.t. dead load/store removal, value 
propagation, etc.  

The rule would be analogous to the rule about functions in declared-pure 
packages.  They need not be called under certain circumstances, independent 
of whether they do or do not have "interesting" side-effects.
It is the programmer's responsibility to create operations that
are consistent with the possibility that they might be "optimized away."

--
-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




  reply	other threads:[~1999-04-19  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-11  0:00 Unreferenced lock variables Simon Wright
1999-04-11  0:00 ` Tom Moran
1999-04-12  0:00 ` Robert Dewar
1999-04-12  0:00   ` Simon Wright
1999-04-12  0:00     ` Robert Dewar
1999-04-12  0:00       ` Simon Wright
1999-04-14  0:00         ` Robert Dewar
1999-04-12  0:00       ` Jean-Pierre Rosen
1999-04-12  0:00         ` Simon Wright
1999-04-13  0:00         ` Robert Dewar
1999-04-13  0:00         ` Robert Dewar
1999-04-13  0:00       ` Tom Moran
1999-04-15  0:00         ` Robert Dewar
1999-04-15  0:00           ` Tom Moran
1999-04-16  0:00             ` Robert Dewar
1999-04-16  0:00               ` Tom Moran
1999-04-16  0:00                 ` Tucker Taft
1999-04-16  0:00                   ` Tom Moran
1999-04-16  0:00                   ` Tom Moran
1999-04-19  0:00                     ` Tucker Taft [this message]
1999-04-20  0:00         ` Tom Moran
1999-04-20  0:00           ` Robert Dewar
1999-04-20  0:00             ` Tom Moran
1999-04-21  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