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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a589e934282bf3d5 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news4.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: GNAT bug: array aggregate containing controlled objects (was: ANN: Simple components for Ada v3.9) Date: Tue, 03 Aug 2010 19:44:50 +0200 Organization: A noiseless patient Spider Message-ID: <87wrs7vbe5.fsf_-_@ludovic-brenta.org> References: <177tljo9yd2wc$.iq67ky4xvjrg$.dlg@40tude.net> <1qyb3t69th9fx.1xxao6etfmeuf.dlg@40tude.net> <1xxnl8zxlrls9$.1tl9y8itzni93.dlg@40tude.net> <5d6c707b-b384-4353-b9f3-e43c310e8b27@j13g2000yqj.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 3 Aug 2010 17:44:59 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="vhtspQ5pQqftjY2c+x4BbQ"; logging-data="6992"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+UdRjAZ1F0qgG+/TIF4prq" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:YmbeOBzqeLooRHroddqtKZ/vZ5Y= sha1:48c/D9UiBAxucrxE+D4ESf/syrQ= Xref: g2news1.google.com comp.lang.ada:12832 Date: 2010-08-03T19:44:50+02:00 List-Id: I wrote on comp.lang.ada: > Dmitry A. Kazakov wrote on comp.lang.ada: >> On Tue, 13 Jul 2010 20:20:00 +0100, Simon Wright wrote: >>> "Dmitry A. Kazakov" writes: >>>> On Tue, 13 Jul 2010 05:45:11 -0700 (PDT), Ludovic Brenta wrote: >>>>>> P.S. In any case in order to use the persistent layer of Simple Components, >>>>>> the gcc 4.4 must be fixed first. The current version has controlled types >>>>>> broken and some other severe issues. >>>>> >>>>> Wow, that's a pretty grave problem; if what you say is true, a fix in >>>>> the stable GCC 4.4 branch is justified. What is the bugzilla number >>>>> for this bug? >>>> >>>> There are several. For example this one: >>> >>> With GCC 4.5.0 and with GNAT GPL 2010 (both on Mac OS X Snow Leopard) >>> this program produces >>> >>>    $ ./controlled_array >>>    Count 1 >>>    Successful finalization >>>    Successful finalization >>>    Successful finalization >> >> This is how it should be. >> >> Debian's or Fedora's gcc 4.4 spits: >> >> Count 2 >> Illegal count in finalization 1 >> >> raised PROGRAM_ERROR : adjust/finalize raised PROGRAM_ERROR: >> controlled_array.adb:18 explicit raise > > > Looks like this might be the patch that corrects this bug: > > 2009-04-17 Thomas Quinot > > * exp_ch7.adb (Expand_Ctrl_Function_Call): Remove incorrect special > case for the case of an aggregate component, the attach call for the > result is actually needed. > > * exp_aggr.adb (Backend_Processing_Possible): Backend processing for > an array aggregate must be disabled if the component type requires > controlled actions. > > * exp_ch3.adb: Minor reformatting > > I'll add a backport of this patch to my long TODO list. The backport actually worked and the compiler in Debian unstable is now fixed. The fix will migrate to testing in a few days. Thank you for reporting. -- Ludovic Brenta.