https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124285

            Bug ID: 124285
           Summary: [12/13/14/15 Regression] raised STORAGE_ERROR : stack
                    overflow or erroneous memory access when building
                    complex record type
           Product: gcc
           Version: 15.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: leo at cubepilot dot com
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

Created attachment 63793
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63793&action=edit
Package specification that fails to build

I get a regression when trying to build a package specification including a
complex record type using discriminant and representation clause for not
aligned elements (see the attached file test.ads).

This package can be built with gcc 11.2.0 but not with gcc 12.1.0 and earlier
(tested up to 15.2.0).

I tried this on Debian 11.11.

I build the package with : "gcc -c test.ads".

With gcc 11.2.0 I get no error and test.ali and test.o are generated.
With gcc 12.1.0 and earlier I get the error "raised STORAGE_ERROR : stack
overflow or erroneous memory access", test.ali is generated but not test.o.

As a work around, adding "pragma Pack (T_My_Record);" prevent the exception to
be raised.

Reply via email to