https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124592
Bug ID: 124592
Summary: [14/15/16 Regression] ICE at -O1 -fprofile-use on
aarch64 during RTL pass: reload in
lra_set_insn_recog_data, at lra.cc:1045
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: xintong.zhou1 at uwaterloo dot ca
Target Milestone: ---
Compiler Explorer: https://godbolt.org/z/Eqsrnvsff
$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/data/x27zhou/compiler-nightly/install/gcc/libexec/gcc/aarch64-unknown-linux-gnu/16.0.1/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /data/x27zhou/compiler-nightly/src/gcc/configure
--enable-checking=yes --disable-bootstrap --disable-multilib
--enable-languages=c,c++ --prefix=/data/x27zhou/compiler-nightly/install/gcc
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 16.0.1 20260320 (experimental) (GCC)
$
$
$ cat small.c
#include "stdlib.h"
int h, i, m;
char j;
void k( int p, int *q) {
int *n = malloc(sizeof(int));
for (; 0 <= p; m++) {
if (m)
j = q[h++];
if (j)
m = n[i];
}
}
void o(int, int, int, int, int, int, int, int, int r) {
k(0, &r);
}
void main() {}
$
$
$ gcc-trunk -O1 -fprofile-use small.c
small.c: In function ‘main’:
small.c:16:1: warning:
‘/data/x27zhou/fuzz-pgo/PGOFuzz/pgofuzz2-output-2026-03-20-22-44-47/crash-gcc-trunk-5912/reduction/a-small.gcda’
profile count data file not found [-Wmissing-profile]
16 | void main() {}
| ^~~~
during RTL pass: reload
small.c: In function ‘o’:
small.c:15:1: internal compiler error: in lra_set_insn_recog_data, at
lra.cc:1045
15 | }
| ^
0x24bb387 internal_error(char const*, ...)
/data/x27zhou/compiler-nightly/src/gcc/gcc/diagnostic-global-context.cc:787
0x871073 fancy_abort(char const*, int, char const*)
/data/x27zhou/compiler-nightly/src/gcc/gcc/diagnostics/context.cc:1813
0xeb6cbf lra_set_insn_recog_data(rtx_insn*)
/data/x27zhou/compiler-nightly/src/gcc/gcc/lra.cc:1045
0xeb755b lra_get_insn_recog_data(rtx_insn*)
/data/x27zhou/compiler-nightly/src/gcc/gcc/lra-int.h:524
0xeb755b setup_sp_offset
/data/x27zhou/compiler-nightly/src/gcc/gcc/lra.cc:1901
0xeb9063 lra_process_new_insns(rtx_insn*, rtx_insn*, rtx_insn*, char const*,
bool)
/data/x27zhou/compiler-nightly/src/gcc/gcc/lra.cc:1949
0xed0f67 curr_insn_transform
/data/x27zhou/compiler-nightly/src/gcc/gcc/lra-constraints.cc:5139
0xed30a7 lra_constraints(bool)
/data/x27zhou/compiler-nightly/src/gcc/gcc/lra-constraints.cc:5793
0xeb855f lra(_IO_FILE*, int)
/data/x27zhou/compiler-nightly/src/gcc/gcc/lra.cc:2504
0xe67463 do_reload
/data/x27zhou/compiler-nightly/src/gcc/gcc/ira.cc:6076
0xe67463 execute
/data/x27zhou/compiler-nightly/src/gcc/gcc/ira.cc:6264
/data/x27zhou/compiler-nightly/install/gcc/libexec/gcc/aarch64-unknown-linux-gnu/16.0.1/cc1
-quiet -imultiarch aarch64-linux-gnu small.c -quiet -dumpdir a- -dumpbase
small.c -dumpbase-ext .c -mlittle-endian -mabi=lp64 -O1 -fprofile-use -o
/tmp/ccCICXYD.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
No profile data is needed after reduction.