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

Robert Dewar <robert_dewar@my-dejanews.com> writes:

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

In what way irrelevant? Am I supposed not to use -O3? or do you just
mean that there is no distinction here between 2 and 3 (I only have
the 3.10 version of the secret manual here, it indicates that -O3 only
adds automatic inlining).

I certainly saw this with GNAT 3.11p, the compiler warned that the
variable was unused, when I compiled -O3 there was a misbehaviour in
my code explainable as above, change the code to achieve the
side-effect via a procedure call in the body and the misbehaviour goes
away. I can try to reconstitute the problem and report it (if it is
indeed a bug to optimize away the initialization of an unused
variable? it struck me at the time that it was much more my fault!)




  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
1999-04-12  0:00       ` Simon Wright [this message]
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-19  0:00                     ` Tucker Taft
1999-04-16  0:00                   ` Tom Moran
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