https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117018
Bug ID: 117018
Summary: Compiler error with iterated array aggregate
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: simon at pushface dot org
CC: dkm at gcc dot gnu.org
Target Milestone: ---
This is in the same area as PR113036, but different symptoms.
The error doesn’t happen if either
* Maxindex is declared "constant Integer"
* the call to ResetCPUTime is removed.
pragma Ada_2022;
procedure TestClok is
procedure ResetCPUTime is null;
Maxindex : Integer := 100;
begin
ResetCPUTime;
declare
A : array (1 .. Maxindex, 1 .. Maxindex) of Integer
:= (for I in 1 .. MaxIndex => (for J in 1 .. MaxIndex => I * J));
begin
null;
end;
end TestClok;
$ gnatmake testclok.adb
gcc -c testclok.adb
+===========================GNAT BUG DETECTED==============================+
| 14.2.0 (aarch64-apple-darwin21) GCC error: |
| in gnat_to_gnu_entity, at ada/gcc-interface/decl.cc:464 |
| Error detected at testclok.adb:10:52 |
| Compiling testclok.adb |
| Please submit a bug report; see https://gcc.gnu.org/bugs/ . |
| 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 command that you entered. |
| Also include sources listed below. |
+==========================================================================+
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).
testclok.adb
compilation abandoned
gnatmake: "testclok.adb" compilation error