This bug is triggered by assigning a private variable of a protected object as
the default expression of its private protected procedure's parameter.

-----------------------------------------------------------------------------

$ gnatgcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/gnat-4.01/work/gcc-4.0.1/configure
--prefix=/usr --program-prefix=gnat --enable-languages=c,ada --enable-libada
--with-gcc --with-gnu-ld --with-gnu-as --enable-threads=posix --enable-shared
--with-system-zlib --disable-nls --libdir=/usr/lib/ada
--libexecdir=/usr/libexec/ada --mandir=/usr/share/man --infodir=/usr/share/info
Thread model: posix
gcc version 4.0.1

-----------------------------------------------------------------------------

$ gnatmake bug
gnatgcc -c bug.adb
+===========================GNAT BUG DETECTED==============================+
| 4.0.1 (i686-pc-linux-gnu) Assert_Failure atree.adb:812                   |
| Error detected at bug.adb:15:50                                          |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
| 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.

bug.adb

compilation abandoned
gnatmake: "bug.adb" compilation error

-----------------------------------------------------------------------------

-------- begin file: bug.adb --------
procedure Bug is

   protected Object is

      entry Trigger;

   private

      Private_Variable : Integer;

   end Object;

   protected body Object is

      procedure Bug_Happens_Here (I : Integer := Private_Variable) is
      begin
         null;
      end Bug_Happens_Here;

      entry Trigger
         when True is
      begin
         Bug_Happens_Here;
      end Trigger;

   end Object;

begin
   null;
end Bug;
-------- end file: bug.adb --------

-- 
           Summary: Bug box: Assert_Failure atree.adb:812
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kat-zygfryd at o2 dot pl
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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

Reply via email to