Attached files generate Stack Overflow when compiled with -c -gnatc and -gnatt.
 With only -c and either of the other two, no problems.

Problem also exists in prior 4.0 snapshot, and as I recall, in the 4.0 release
as well.

package Toplevel is

end Toplevel;
package Toplevel.Intermediate is

  An_Prefix   : constant String := "An_Prefix";
  Al_Prefix   : constant String := "Al_Prefix";

end Toplevel.Intermediate;
with Toplevel.Intermediate;

package Toplevel.Midlevel is

  Al_Prefix : String renames Toplevel.Intermediate.Al_Prefix;
  An_Prefix : String renames Toplevel.Intermediate.An_Prefix;

end Toplevel.Midlevel;
package Toplevel.Midlevel.Bottom is

   function Blank return Boolean;

end Toplevel.Midlevel.Bottom;

8:23 1290 submit: mkdir /tmp/jjj
8:24 1291 submit: cat *.ads > /tmp/jjj/files
8:24 1292 submit: cd /tmp/jjj
8:24 1293 jjj: l
total 4
-rw-r--r--  1 karl karl 502 May  2 08:24 files
8:24 1294 jjj: gnatchop files
splitting files into:
   toplevel.ads
   toplevel-intermediate.ads
   toplevel-midlevel.ads
   toplevel-midlevel-bottom.ads
8:24 1295 jjj: l
total 20
-rw-r--r--  1 karl karl 502 May  2 08:24 files
-rw-r--r--  1 karl karl  35 May  2 08:24 toplevel.ads
-rw-r--r--  1 karl karl 158 May  2 08:24 toplevel-intermediate.ads
-rw-r--r--  1 karl karl 207 May  2 08:24 toplevel-midlevel.ads
-rw-r--r--  1 karl karl 102 May  2 08:24 toplevel-midlevel-bottom.ads
8:24 1296 jjj: !gcc
gcc -c -gnatc -gnatt *.ads
+===========================GNAT BUG DETECTED==============================+
| 4.0.1 20050430 (prerelease) (i686-pc-linux-gnu) Storage_Error stack overflow
(or erroneous memory access)|
| Error detected at system.ads:151:5                                       |
| 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.

toplevel-midlevel-bottom.ads
toplevel-midlevel.ads
toplevel.ads
toplevel-intermediate.ads

compilation abandoned
8:24 1297 jjj: . ~/.cshrc.new
8:25 1298 jjj: which gcc
/home/karl/gcc-4.1-20050501/bin/gcc
8:25 1299 jjj: !gcc
gcc -c -gnatc -gnatt *.ads
+===========================GNAT BUG DETECTED==============================+
| 4.1.0 20050501 (experimental) (i686-pc-linux-gnu) Storage_Error stack overflow
(or erroneous memory access)|
| Error detected at system.ads:152: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.

toplevel-midlevel-bottom.ads
toplevel-midlevel.ads
toplevel.ads
toplevel-intermediate.ads

compilation abandoned
8:25 1300 jjj: gcc -c -gnatc *.ads
8:26 1301 jjj: gcc -c *.ads
cannot generate code for file toplevel-midlevel-bottom.ads (package spec)
to check package spec for errors, use -gnatc
8:26 1302 jjj: gcc -c -gnatt *.ads
cannot generate code for file toplevel-midlevel-bottom.ads (package spec)
to check package spec for errors, use -gnatc
8:26 1303 jjj:

-- 
           Summary: gcc with -c -gnatc and -gnatt generates Stack Overflow
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: karl at grebyn dot com
                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=21338

Reply via email to