[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#333564: ada,gnat: Visibility problem causes a crash instead of a warning



Package: gnat-4.0
Version: 4.0.2-2
Severity: normal


Hello. A program failed to compile, and I tracked down the minimal
program causing the crash. I hope this will help finding the bug. The
source:

--
procedure Demo is

   package P is
      subtype T is Character;
      Const : constant Character := 'a';
   end P;

   Key : P.T;
begin
   case Key is
      when Const =>
         null;
      when others =>
         null;
   end case;
end Demo;
--

The bug must be old, since I got (on Debian testing) it with:
 gnat-4.0.2 (crash message follows)
 gnat-3.4.5 (Assert_Failure namet.adb:567)
 gnat-3.3.6 (Assert_Failure namet.adb:517)
 gnat 3.15p (Assert_Failure namet.adb:545)

An equivalent if-then-end if structure generates an usual warning
because Const is not visible. The problem disappears if "Const" is
written "P.Const".

Crash message:
--
$ gnatmake demo.adb
gcc-4.0 -c demo.adb
+===========================GNAT BUG DETECTED==============================+
| 4.0.2 (Debian 4.0.2-2) (i486-pc-linux-gnu) Assert_Failure namet.adb:599  |
| Error detected at demo.adb:11:12                                         |
| 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-4.0 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.

list may be incomplete
compilation abandoned
gnatmake: "demo.adb" compilation error
--

Thanks for maintaining such a compiler, I miss explicit warnings when
they do not appear. Good bye.


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.12.051007
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)

Versions of packages gnat-4.0 depends on:
ii  gcc-4.0                       4.0.2-2    The GNU C compiler
ii  gcc-4.0-base                  4.0.2-2    The GNU Compiler Collection (base 
ii  libc6                         2.3.5-6    GNU C Library: Shared libraries an
ii  libgcc1                       1:4.0.2-2  GCC support library
ii  libgnat-4.0                   4.0.2-2    Runtime library for GNU Ada applic

gnat-4.0 recommends no packages.

-- no debconf information



Reply to: