https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118164
Bug ID: 118164
Summary: executable fails with storage_error on arm when built
with -O1 -fstack-clash-protection
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: nicolas at debian dot org
CC: dkm at gcc dot gnu.org
Target Milestone: ---
Hello.
The reproducer below
prints raised STORAGE_ERROR : stack overflow or erroneous memory access
on Linux 6.1.0-28-arm64 #1 SMP Debian 6.1.119-1 (2024-11-22) armv8l
Debian GNU/Linux
with GCC Debian 14.2.0-11.
All seems OK with GCC Debian 13.3.0-11, without -O1 or without
-fstack-clash-protection.
The original symptom is visible at
https://buildd.debian.org/status/fetch.php?pkg=libxmlada&arch=armel&ver=25.0.0-3&stamp=1734606375&raw=0
(raised STORAGE_ERROR : stack overflow or erroneous memory access)
https://buildd.debian.org/status/fetch.php?pkg=libxmlada&arch=armhf&ver=25.0.0-3&stamp=1734606245&raw=0
(raised PROGRAM_ERROR : convert.adb:36 finalize/adjust raised exception)
cat > p.adb <<EOF
with Ada.Containers.Indefinite_Vectors;
procedure P is
package SV is new Ada.Containers.Indefinite_Vectors (Positive, String);
V : SV.Vector;
begin
for I in 1 .. 1025 loop
V.Append ("");
end loop;
end P;
EOF
gnatmake p.adb -cargs -O1 -fstack-clash-protection
./p