comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-dejanews.com>
Subject: Re: Unreferenced lock variables
Date: 1999/04/12
Date: 1999-04-12T00:00:00+00:00	[thread overview]
Message-ID: <7esrmv$k1n$1@nnrp1.dejanews.com> (raw)
In-Reply-To: x7vk8viqsla.fsf@pogner.moho

In article <x7vk8viqsla.fsf@pogner.moho>,
  Simon Wright <simon@pogner.demon.co.uk> wrote:
> Because I'm concerned that aggressive optimization (-O3)
> will eliminate the lock variable altogether.
>
> The last time this happened was
>
>   Dummy : Foo := Some_Function_With_Side_Effects;
>
> and -O3 ended up without the side effects.


Well that would have course have been a significant bug,
and we have never seen any such bug in -O2 mode (-O3
is irrelevant here), nor had any such problem reported
that I can remember. The backend may well remove the
variable itself, but cannot remove the call.

With regard to initialization and finalization, the ARG
just agreed (unwisely if you ask me!) to allow a compiler
to optimize away initialization and finalization for an
otherwise unreferenced variable. GNAT does not take
advantage of this, but it means that to be compeltely
portable, you need to put in a dummy reference to the
variable.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  reply	other threads:[~1999-04-12  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 [this message]
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
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