Bug 106037 - ICE with Aggregate aspect
Summary: ICE with Aggregate aspect
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 12.1.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-20 22:38 UTC by Jesper Quorning
Modified: 2022-07-02 16:16 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2022-07-01 00:00:00


Attachments
Source from Description (161 bytes, text/plain)
2022-06-20 22:38 UTC, Jesper Quorning
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesper Quorning 2022-06-20 22:38:58 UTC
Created attachment 53174 [details]
Source from Description

This causes ICE with 12.1.0:

procedure Container_Aggregates is

   type Array_Type is
     array (1 .. 10) of Integer
   with Aggregate => (Empty => Empty_Array);

   Empty_Array : constant Array_Type := [1..10 => 123];

begin
   null;
end Container_Aggregates;

ICE:

% gnatmake -gnat2022 container_aggregates.adb
gcc -c -gnat2022 container_aggregates.adb
+===========================GNAT BUG DETECTED==============================+
| 12.1.0 (x86_64-apple-darwin15) Program_Error sem_type.adb:837 explicit raise|
| Error detected at container_aggregates.adb:7:43                          |
| Compiling container_aggregates.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.                                       |
+==========================================================================+
Comment 1 Eric Botcazou 2022-07-01 11:07:10 UTC
On mainline:

+===========================GNAT BUG DETECTED==============================+
| 13.0.0 20220701 (experimental) [master bb6325c8ad2] (x86_64-suse-linux)  |
| Assert_Failure failed precondition from sinfo-nodes.ads:3970
Comment 2 Pascal Pignard 2022-07-02 16:16:39 UTC
Same error with iterated element association in aggregate:

597.          declare
598.             Keys : constant array (Positive range <>) of Integer := [2, 3, 5, 7, 11];
599.          begin
600. 
601.             --  A map aggregate where the values produced by the
602.             --  iterated_element_association are of the same type as the key
603.             --  (eliminating the need for a separate key_expression):
604. 
605.                M := [for Key1 of Keys => Integer'Image (Key1)];

+===========================GNAT BUG DETECTED==============================+
| 12.1.0 (x86_64-apple-darwin19.6.0) Program_Error sem_type.adb:837 explicit raise|
| Error detected at aarm_202x_ch04.adb:605:21