This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ada/52752] New: GNAT bug box on instantiation of subprogram with "not null"-qualified named access type


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

             Bug #: 52752
           Summary: GNAT bug box on instantiation of subprogram with "not
                    null"-qualified named access type
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: lithiumcat@gmail.com


Created attachment 27021
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27021
Minimal testcase triggering the bug box

It seems that GNAT compilation fails when I instantiate a subprogram when one
of its argument is of type "not null Named_Access_Type".

It can be reproduced using the attached gnatchop'ed Ada source:

$ gnatchop testcase.ada
splitting testcase.ada into:
   test.ads
   test.adb
   testcase.adb
$ gnatmake testcase.adb
gnatgcc -c testcase.adb
gnatgcc -c test.adb
+===========================GNAT BUG DETECTED==============================+
| 4.6.2 20111026 (release) -=> GNAT AUX [FreeBSD64] (x86_64-aux-freebsd9.0) GCC
error:|
| in gnat_to_gnu_entity, at ada/gcc-interface/decl.c:4134                  |
| Error detected at test.adb:8:4 [test.adb:29:4]                           |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
| 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).                   |
+==========================================================================+

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).

test.adb
test.ads

compilation abandoned
gnatmake: "test.adb" compilation error



Using exactly the same source but without the "not null" qualifications does
not trigger the bug. Similarly, putting the "not null" qualification in the
type declaration instead of in the argument does not trigger the bug either.
In both cases, here is the output:

$ gnatmake testcase.adb
gnatgcc -c testcase.adb
gnatgcc -c test.adb
gnatbind -x testcase.ali
gnatlink testcase.ali
$ ./testcase
Testcase
$

As the bug box mentions, I'm using a patched gcc version, known as gnat-aux,
usable on FreeBSD. However the bug has been confirmed on AdaCore's version by
several people in comp.lang.ada, so it is likely to be present in all GNAT
versions, so I'm still reporting it here.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]