From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7f1e0b399cd01cb0 X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: Unreferenced lock variables Date: 1999/04/19 Message-ID: #1/1 X-Deja-AN: 468118417 Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: <3717b010.18059463@news.pacbell.net> Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1999-04-19T00:00:00+00:00 List-Id: 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) : > : 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