https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123861
Bug ID: 123861
Summary: ICE on compare with anonymous empty vector
Product: gcc
Version: 15.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: jesper.quorning at gmail dot com
CC: dkm at gcc dot gnu.org
Target Milestone: ---
Hi again :-),
Stumbled into an ICE reproduced with this minimal program:
```ada
with Ada.Containers.Vectors;
procedure Ice_Compare
is
package Integer_Vectors is new
Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Integer);
use Integer_Vectors;
A : constant Vector := [];
B : constant Boolean := [] = A; -- ICE
C : constant Boolean := Vector'[] = A; -- Works
D : constant Boolean := A = []; -- Works
begin
null;
end Ice_Compare;
```
Build with:
$ gnatmake -gnat2022 ice_compare.adb
Top of bug box:
+===========================GNAT BUG DETECTED==============================+
| 15.2.0 (x86_64-apple-darwin22.6.0) Constraint_Error erroneous memory access|
| Error detected at ice_compare.adb:11:28 |
| Compiling ice_compare.adb |
Seems to work with GNAT 14.2.
Thanks