https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127994
Bug ID: 127994
Summary: GNAT BUG DETECTED in extension aggregate
Product: gcc
Version: 16.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: krischik at users dot sourceforge.net
CC: dkm at gcc dot gnu.org
Target Milestone: ---
Created attachment 65890
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65890&action=edit
Sources requested by GNAT BUG DETECTED box
## Exact version of GCC
```
alr exec -P1 -- gcc --version
gcc (GNAT-FSF-builds) 16.1.0
Copyright (C) 2026 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```
## System type
```
alr exec -P1 -- gcc -dumpmachine
x86_64-apple-darwin24.6.0
```
```
uname -a
Darwin iMac.local 25.6.0 Darwin Kernel Version 25.6.0: Fri Jul 31 19:11:49 PDT
2026; root:xnu-12377.161.14~5/RELEASE_X86_64 x86_64
```
```
sw_vers
ProductName: macOS
ProductVersion: 26.6.2
BuildVersion: 25G83
```
The same crash also occurs on Windows.
## Options when GCC was configured/built
The compiler is the one delivered by Alire (GNAT-FSF-builds):
```
alr exec -P1 -- gcc -v
Target: x86_64-apple-darwin24.6.0
Configured with: ../src/configure
--prefix=/Users/runner/work/GNAT-FSF-builds/GNAT-FSF-builds/sbx/x86_64-darwin/gcc/install
--enable-languages=c,ada,c++ --enable-libstdcxx --enable-libstdcxx-threads
--enable-libada --with-pkgversion=GNAT-FSF-builds --disable-nls
--without-libiconv-prefix --disable-libstdcxx-pch --enable-lto
--disable-multilib --disable-libcilkrts
--with-build-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
--with-specs='%{!-sysroot=*:--sysroot=%:if-exists-else(/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk)}'
--with-mpfr=/Users/runner/work/GNAT-FSF-builds/GNAT-FSF-builds/sbx/x86_64-darwin/mpfr/install
--with-gmp=/Users/runner/work/GNAT-FSF-builds/GNAT-FSF-builds/sbx/x86_64-darwin/gmp/install
--with-mpc=/Users/runner/work/GNAT-FSF-builds/GNAT-FSF-builds/sbx/x86_64-darwin/mpc/install
--build=x86_64-apple-darwin24.6.0
Thread model: posix
```
## Exact command line that triggers the bug
```
alr -v build --development
```
which invokes:
```
gnat_native_16.1.0_bb6d1434/bin/gcc -c -x ada -gnatA -Og -ffunction-sections
-fdata-sections -g -gnatp -gnato -gnatwa -gnatw.X -gnatVa -gnata -gnaty3
-gnatya -gnatyA -gnatyB -gnatyb -gnatyc -gnaty-d -gnatye -gnatyf -gnatyh
-gnatyi -gnatyI -gnatyk -gnatyl -gnatym -gnatyn -gnatyO -gnatyp -gnatyr -gnatyS
-gnatyt -gnatyu -gnatyx -gnat2022 -gnatW8 -gnat2022 -gnatef -gnatW8 -gnatwn
-gnatX -gnaty-I -gnatyM120 -gnatec=/private/tmp/GPR.47008/GNAT-TEMP-000003.TMP
-gnatem=/private/tmp/GPR.47008/GNAT-TEMP-000012.TMP
/Users/Shared/Work/Projects/AdaCL/develop/adacl_sar/src/adacl-wide_wide_sar-filter-list.ads
```
## Source files
A collection of source files is attached.
## Expected behaviour
Compile is successful
## Actual behaviour
Compilation aborts with a GNAT bug box:
+===========================GNAT BUG DETECTED==============================+
| 16.1.0 (x86_64-apple-darwin24.6.0) Program_Error sem_ch8.adb:6084 explicit
raise|
| Error detected at adacl-sar-file-write_task.adb:42:65 |
| Compiling
/Users/Shared/Work/Projects/AdaCL/develop/adacl_sar/src/adacl-sar-file-write_task.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. |
+==========================================================================+
NOTE: The extension aggregate is syntactically well-formed. The assignment of
Owner is, however, logically incorrect: it creates an unwanted copy of the
owner object. A different approach is required for the intended design.
I report because a compiler crash (“GNAT BUG DETECTED”) must never occur on
well-formed source, even when the program contains logical errors.