comp.lang.ada
 help / color / mirror / Atom feed
From: "Hibou57 (Yannick Duchêne)" <yannick_duchene@yahoo.fr>
Subject: Re: GNAT crunch (suspected bug with types derived from unchecked union)
Date: Mon, 13 Jul 2009 08:27:14 -0700 (PDT)
Date: 2009-07-13T08:27:14-07:00	[thread overview]
Message-ID: <41f6643a-dd32-4668-9742-d2511f6bc345@d34g2000vbm.googlegroups.com> (raw)
In-Reply-To: 035b713e-6056-4a4f-a623-6940736a9fc4@e18g2000vbe.googlegroups.com

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



  reply	other threads:[~2009-07-13 15:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-13 10:49 GNAT crunch (suspected bug with types derived from unchecked union) Hibou57 (Yannick Duchêne)
2009-07-13 12:51 ` Hibou57 (Yannick Duchêne)
2009-07-13 15:27   ` Hibou57 (Yannick Duchêne) [this message]
2009-07-13 21:59     ` sjw
2009-07-13 23:59       ` Hibou57 (Yannick Duchêne)
replies disabled

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