public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/34507]  New: Bug box, Assert_Failure einfo.adb:814 on illegal Ada 2005 program
@ 2007-12-17  9:28 ludovic at ludovic-brenta dot org
  2007-12-17  9:31 ` [Bug ada/34507] " ludovic at ludovic-brenta dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ludovic at ludovic-brenta dot org @ 2007-12-17  9:28 UTC (permalink / raw)
  To: gcc-bugs

package pak1 is
   type T1(<>) is tagged limited private;
private
   type T1(D: integer) is tagged limited null record;
end pak1;

with pak1;
package pak2 is
   type T2 is new pak1.T1 with null record;   -- ERROR: invalid constraint
   x1: T2 := (pak1.T1 with null record); -- line 5
end pak2;

package pak1.pak3 is
   type T3 is new pak1.T1 with null record;   -- ERROR: invalid constraint
   x2: T3 := (pak1.T1 with null record);
end pak1.pak3;

GCC 4.1:

gnatmake -gnat05 pak2
gcc-4.1 -c -gnat05 pak2.ads
+===========================GNAT BUG DETECTED==============================+
| 4.1.3 20070518 (prerelease) (Debian 4.1.2-8) (x86_64-pc-linux-gnu)       |
| Assert_Failure einfo.adb:813                                             |
| Error detected at pak2.ads:5:4                                           |

gnatmake -gnat05 pak1-pak3.ads
gcc-4.1 -c -gnat05 pak1-pak3.ads
pak1-pak3.ads:3:15: invalid constraint: type has no discriminant
pak1-pak3.ads:4:14: no value supplied for discriminant "D"

GCC 4.2:

% gcc -c pak2.ads
+===========================GNAT BUG DETECTED==============================+
| 4.2.2 (i686-unknown-linux-gnu) Assert_Failure einfo.adb:814              |
| Error detected at pak2.ads:5:4                                           |

% gcc -c pak1-pak3.ads
pak1-pak3.ads:3:15: invalid constraint: type has no discriminant
pak1-pak3.ads:4:14: no value supplied for discriminant "D"

As can be seen, Pak1.Pak3 and Pak2 are identical but only Pak2 triggers the
bug.


-- 
           Summary: Bug box, Assert_Failure einfo.adb:814 on illegal Ada
                    2005 program
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ludovic at ludovic-brenta dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34507


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug ada/34507] Bug box, Assert_Failure einfo.adb:814 on illegal Ada 2005 program
  2007-12-17  9:28 [Bug ada/34507] New: Bug box, Assert_Failure einfo.adb:814 on illegal Ada 2005 program ludovic at ludovic-brenta dot org
@ 2007-12-17  9:31 ` ludovic at ludovic-brenta dot org
  2009-03-01 21:52 ` bauhaus at futureapps dot de
  2009-03-08 10:05 ` [Bug ada/34507] Assert_Failure at einfo.adb:837 " ebotcazou at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: ludovic at ludovic-brenta dot org @ 2007-12-17  9:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ludovic at ludovic-brenta dot org  2007-12-17 09:30 -------
The initial test case was incorrect regarding the lines marked "ERROR".
Here's a corrected version:

package pak1 is
   type T1(<>) is tagged limited private;
private
   type T1(D: integer) is tagged limited null record;
end pak1;

with pak1;
package pak2 is
   type T2 is new pak1.T1 with null record;   -- legal
   x1: T2 := (pak1.T1 with null record);      -- ERROR, but accepted
end pak2;

package pak1.pak3 is
   type T3 is new pak1.T1 with null record;   -- legal, but rejected
   x2: T3 := (pak1.T1 with null record);      -- legal, but rejected
end pak1.pak3;

So in fact, Pak1.Pak3 also triggers a bug, albeit a different one from Pak2. 
I'll file it separately.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34507


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug ada/34507] Bug box, Assert_Failure einfo.adb:814 on illegal Ada 2005 program
  2007-12-17  9:28 [Bug ada/34507] New: Bug box, Assert_Failure einfo.adb:814 on illegal Ada 2005 program ludovic at ludovic-brenta dot org
  2007-12-17  9:31 ` [Bug ada/34507] " ludovic at ludovic-brenta dot org
@ 2009-03-01 21:52 ` bauhaus at futureapps dot de
  2009-03-08 10:05 ` [Bug ada/34507] Assert_Failure at einfo.adb:837 " ebotcazou at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: bauhaus at futureapps dot de @ 2009-03-01 21:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from bauhaus at futureapps dot de  2009-03-01 21:52 -------
This is still present in 4.4.0
gcc -c pak2.ads
+===========================GNAT BUG DETECTED==============================+
| 4.4.0 20090301 (experimental) (x86_64-unknown-linux-gnu) Assert_Failure
einfo.adb:837|
| Error detected at pak2.ads:5:4   
...
pak2.ads
pak1.ads
/opt/gcc4/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/adainclude/a-unccon.ads

(The assertion mentioned here to be on line 837 is the very same,
in function Discriminant_Constraint.)

A similar case triggering the same bug box,
referring to the same function in einfo.adb:

package T_Pack is

   type T (<>) is abstract tagged limited private;

private
   type T (C: Character) is abstract tagged limited null record;
end T_Pack;

with T_Pack;

package S_Pack is

   use T_Pack;

   type S is new T with private;
   function Create return S;

private
   type S is new T with null record;

end S_Pack;

package body S_Pack is

   function Create return S is
   begin
      return S'(T with null record);
   end Create;

end S_Pack;


$ gnatmake s_pack.adb
gcc -c s_pack.adb
+===========================GNAT BUG DETECTED==============================+
| 4.4.0 20090301 (experimental) (x86_64-unknown-linux-gnu) Assert_Failure
einfo.adb:837|
| Error detected at s_pack.adb:5:7   
...
Please include...
s_pack.adb
s_pack.ads
t_pack.ads

$ gcc -v
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: /troy.d/gnatmail/release-gpl/build-troy/src/configure
--prefix=/usr/gnat --target=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--build=x86_64-pc-linux-gnu --enable-languages=c,ada --disable-nls
--disable-libada --enable-checking=release --enable-threads=posix
--disable-multilib
Thread model: posix
gcc version 4.1.3 20080522 for GNAT GPL 2008 (20080521)

$ svn info
Path: .
URL: svn://gcc.gnu.org/svn/gcc/trunk
Repository Root: svn://gcc.gnu.org/svn/gcc
Repository UUID: 138bc75d-0d04-0410-961f-82ee72b054a4
Revision: 144501
Node Kind: directory
Schedule: normal
Last Changed Author: gccadmin
Last Changed Rev: 144501
Last Changed Date: 2009-03-01 01:16:55 +0100 (Sun, 01 Mar 2009)


-- 

bauhaus at futureapps dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bauhaus at futureapps dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34507


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug ada/34507] Assert_Failure at einfo.adb:837 on illegal Ada 2005 program
  2007-12-17  9:28 [Bug ada/34507] New: Bug box, Assert_Failure einfo.adb:814 on illegal Ada 2005 program ludovic at ludovic-brenta dot org
  2007-12-17  9:31 ` [Bug ada/34507] " ludovic at ludovic-brenta dot org
  2009-03-01 21:52 ` bauhaus at futureapps dot de
@ 2009-03-08 10:05 ` ebotcazou at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2009-03-08 10:05 UTC (permalink / raw)
  To: gcc-bugs



-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|4.1.2 4.2.2                 |4.1.2 4.2.2 4.4.0
   Last reconfirmed|0000-00-00 00:00:00         |2009-03-08 10:05:30
               date|                            |
            Summary|Bug box, Assert_Failure     |Assert_Failure at
                   |einfo.adb:814 on illegal Ada|einfo.adb:837 on illegal Ada
                   |2005 program                |2005 program


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34507


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-03-08 10:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-17  9:28 [Bug ada/34507] New: Bug box, Assert_Failure einfo.adb:814 on illegal Ada 2005 program ludovic at ludovic-brenta dot org
2007-12-17  9:31 ` [Bug ada/34507] " ludovic at ludovic-brenta dot org
2009-03-01 21:52 ` bauhaus at futureapps dot de
2009-03-08 10:05 ` [Bug ada/34507] Assert_Failure at einfo.adb:837 " ebotcazou at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).