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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,f4387ccd1be41cbe X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!d34g2000vbm.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: GNAT crunch (suspected bug with types derived from unchecked union) Date: Mon, 13 Jul 2009 08:27:14 -0700 (PDT) Organization: http://groups.google.com Message-ID: <41f6643a-dd32-4668-9742-d2511f6bc345@d34g2000vbm.googlegroups.com> References: <8ad56610-f2e7-4a69-98fc-516e84822582@l28g2000vba.googlegroups.com> <035b713e-6056-4a4f-a623-6940736a9fc4@e18g2000vbe.googlegroups.com> NNTP-Posting-Host: 86.75.149.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1247498835 16946 127.0.0.1 (13 Jul 2009 15:27:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 13 Jul 2009 15:27:15 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d34g2000vbm.googlegroups.com; posting-host=86.75.149.197; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:7029 Date: 2009-07-13T08:27:14-07:00 List-Id: Isolated version of the bug (posted here for people with interest, will be submitted to AdaCore latter in the day): -- File p.ads | package P is | | type Derived (<>) is private; | | function Return_Derived return Derived; | | private | | type Discriminant_Kinds is (Choice); | | type Base (Discriminant : Discriminant_Kinds := Choice) | is | record | case Discriminant is | when Choice => | Component : Natural; | end case; | end record; | | pragma Unchecked_Union (Base); | | type Derived is new Base; | | pragma Unchecked_Union (Derived); | | end P; -- File p.adb | package body P is | | function Return_Derived return Derived is | begin | return Derived'(Discriminant => Choice, Component => 0); | end Return_Derived; | | end P; -- File client.adb | with P; | | procedure Client is | Instance : P.Derived := P.Return_Derived; | begin | null; | end Client; -- The message I got from the compiler > gnatmake -ws -c -u -PC:\\Ada\\gnat-bug-pragma-unchecked\\bug.gpr client.adb -s -q > +===========================GNAT BUG DETECTED==============================+ > | GPL 2009 (20090519) (i686-pc-mingw32) Program_Error EXCEPTION_ACCESS_VIOLATION| > | Error detected at system.ads:200:5 | > | Please submit a bug report by email to report@adacore.com. | > | GAP members can alternatively use GNAT Tracker: | > | http://www.adacore.com/ section 'send a report'. | > | See gnatinfo.txt for full info on procedure for submitting bugs. | > | Use a subject line meaningful to you and us to track the bug. | > | Include the entire contents of this bug box in the report. | > | Include the exact gcc or gnatmake command that you entered. | > | Also include sources listed below in gnatchop format | > | (concatenated together with no headers between files). | > | Use plain ASCII or MIME attachment. | > +==========================================================================+ > > Please include these source files with error report > Note that list may not be accurate in some cases, > so please double check that the problem can still > be reproduced with the set of files listed. > Consider also -gnatd.n switch (see debug.adb). > > C:\Ada\gnat-bug-pragma-unchecked\client.adb > C:\ada\gnat-bug-pragma-unchecked\binaries\GNAT-TEMP-000001.TMP > C:\ada\gnat-bug-pragma-unchecked\binaries\GNAT-TEMP-000002.TMP > c:\ada\gnat-bug-pragma-unchecked\p.ads > > compilation abandoned > gnatmake: "c:\ada\gnat-bug-pragma-unchecked\client.adb" compilation error