http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46707
Summary: Storage_Error in GNAT with anonymous "not null" subtype Product: gcc Version: 4.5.1 Status: UNCONFIRMED Severity: minor Priority: P3 Component: ada AssignedTo: unassig...@gcc.gnu.org ReportedBy: jp.sittingduck+...@gmail.com Host: Linux 2.6.35 (Arch Linux), x86_64 Target: Linux 2.6.35 (Arch Linux), x86_64 ===== GCC version $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../configure --prefix=/usr --enable-languages=c,c++,fortran,objc,obj-c++,ada --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-gnu-unique-object --enable-lto --enable-plugin --disable-multilib --disable-libstdcxx-pch --with-system-zlib --with-ppl --with-cloog --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info Thread model: posix gcc version 4.5.1 (GCC) ===== Test case $ cat foo.ads package Foo is type Integer_Access is access Integer; procedure Test (I: not null Integer_Access) is abstract; end Foo; ===== Expected behaviour Compilation of spec file. ===== Actual behaviour $ gcc -save-temps -c foo.ads +===========================GNAT BUG DETECTED==============================+ | 4.5.1 (x86_64-unknown-linux-gnu) Storage_Error stack overflow (or erroneous memory access)| | Error detected at system.ads:153:5 | | 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). foo.ads compilation abandoned $ cat foo.s .file "foo.ads" ===== Workaround ... subtype Not_Null_Integer_Access is not null Integer_Access; procedure Test (I: Not_Null_Integer_Access) is abstract; ... The bug also doesn't show when "not null" is removed completely.