http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58881
Bug ID: 58881
Summary: GNAT crashes with bug box when trying to instantiate a
generic package
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: contact at flyx dot org
When compiling attached code, I get the following bug box:
+===========================GNAT BUG DETECTED==============================+
| 4.8.1 (x86_64-apple-darwin12) Constraint_Error erroneous memory access |
| Error detected at gl-objects-textures-with_1d_loader.ads:31:4
[gl-objects-textures-targets.ads:28: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). |
+==========================================================================+
Attached file consists of multiple source files, to compile it, you have to do
gnatchop packed.adb
gcc -c gl_test-framebuffers.adb
This will produce the bug box.
Unfortunately, I don't have a more recent of GNAT to do more testing. I do have
GNAT GPL 2013 from AdaCore available, which includes GCC 4.7.4 and also runs
into this bug.
I tried to reproduce the bug with less code, but wasn't successful. I did
notice that removing the type Fillable_Target from the file
gl-objects-textures-with_1d_loader.ads fixes the problem.
My GCC was compiled with:
Target: x86_64-apple-darwin12
Configured with:
../gcc-4.8.1/configure \
--prefix=/opt/gcc-4.8.1 \
--disable-multilib \
--enable-languages=c,c++,ada,fortran,objc,obj-c++ \
--target=x86_64-apple-darwin12 \
--build=x86_64-apple-darwin12
Thread model: posix