comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Bug in GNAT GPL 2006?
Date: Thu, 22 Feb 2007 20:37:37 -0500
Date: 2007-02-22T20:37:37-05:00	[thread overview]
Message-ID: <wccwt29k61q.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: C20377D8.98A4B%yaldnif.w@blueyonder.co.uk

"(see below)" <yaldnif.w@blueyonder.co.uk> writes:

> On 22/2/07 10:52, in article 545av3F1ukgfpU1@mid.individual.net, "Alex R.
> Mosteo" <devnull@mailinator.com> wrote:
>
>> (see below) wrote:
>> 
>>> Using GNAT GPL 2006 (20060522-34) I get warning messages
>>> like the following when using extended return statements:
>>> 
>>>     function is_empty (the_table : a_safe_table) return Boolean is
>>>     begin
>>>        return result : Boolean do
>>>               |
>>>>>> warning: variable "result" is assigned but never read
>>> 
>>>           lock_table;
>>>              result := is_empty(a_basic_table(the_table));
>>>           unlock_table;
>>>        end return;
>>>     end is_empty;
>>> 
>>> I'm inclined to assume that this is a compiler bug, but can
>>> anyone more knowledgeable about Ada 200[57] confirm this?
>>  
>> It was my impression that extended return wasn't completely finished.
>
> Looks like it. Trouble is, I can't find anything on the Libre
> site that defines what is or is not finished in GNAT GPL. 8-(
>
>> Did you get that to work, despite the warning?
>
> Yes, that runs properly as far as I have tested it.
>
> This bug:
>
>>> Obtaining the value of a defining identifier from a call to another
>>> (inlined) function having itself an extended return also fails to compile;
>>> giving a nonsensical message at the point of call of the latter.
>
> is interesting - if I interpret the error message correctly,
> the compiler is trying (in effect) to textually nest the extended
> return of the subsidiary function inside the caller's extended return
> and then complaining that the product of doing that is illegal
> (as I would hope it is).
>
> It compiles correctly (modulo further testing) if inlining is switched off.

If you report this inlining bug to AdaCore, it will eventually get
fixed.  In fact, I've been working on this extended-return stuff lately,
so I am indeed interested in seeing bug reports related to that.

By the way, I think the bogus warning mentioned above is fixed in the
latest GNAT sources.  And as far as I know, the generated code is
correct even in the presence of that warning.

- Bob



  reply	other threads:[~2007-02-23  1:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-21 19:47 Bug in GNAT GPL 2006? (see below)
2007-02-21 20:19 ` Randy Brukardt
2007-02-21 20:57   ` (see below)
2007-02-22  2:14   ` Adam Beneschan
2007-02-22  6:09     ` (see below)
2007-02-22  6:53       ` Per Sandberg
2007-02-22 10:52 ` Alex R. Mosteo
2007-02-22 16:39   ` (see below)
2007-02-23  1:37     ` Robert A Duff [this message]
2007-02-23  3:51       ` (see below)
2007-02-24 19:15         ` Robert A Duff
2007-02-24 20:52           ` Georg Bauhaus
2007-02-25  1:21           ` Jeffrey R. Carter
2007-02-23 14:04 ` The Ada 2005 name (was: Re: Bug in GNAT GPL 2006?) Dirk Craeynest
2007-02-24 10:47   ` The Ada 2005 name Stephen Leake
replies disabled

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