https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124375
Bug ID: 124375
Summary: ICE when compiling glibc with -fanalyzer
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: analyzer
Assignee: dmalcolm at gcc dot gnu.org
Reporter: arjun at shankar dot eu
Target Milestone: ---
I tried compiling glibc with -fanalyzer on Fedora Rawhide while trying to
locally reproduce the GCC analyzer results from Fedora OpenScanHub. I used the
following configure line:
$ $glibcsrcdir/configure --prefix=/usr --disable-werror CFLAGS="-O2 -fanalyzer
-fdiagnostics-format=sarif-file"
The subsequent parallel make runs into multiple ICEs in the analyzer pass.
I have reduced one of the reproducers with cvise to:
$ cat >reproducer.c <<EOF
char __printf_buffer_spec;
int __printf_buffer_offset;
void *__printf_buffer_ptr;
void __printf_buffer() {
int step0_jumps[] = {&&do_flag_hash - &&do_form_unknown};
do_flag_hash:
__printf_buffer_offset = __printf_buffer_spec
? &&do_form_unknown - &&do_form_unknown
: step0_jumps[' '];
__printf_buffer_ptr = &&do_form_unknown + __printf_buffer_offset;
goto *__printf_buffer_ptr;
do_form_unknown:
}
EOF
$ cc1 reproducer.c -O2 -fanalyzer
__printf_buffer
Analyzing compilation unit
Performing interprocedural optimizations
<*free_lang_data> {heap 976k} <visibility> {heap 976k} <build_ssa_passes>
{heap 976k} <targetclone> {heap 1388k} <opt_local_passes> {heap 1388k}
<remove_symbols> {heap 1788k} <targetclone> {heap 1788k} <free-fnsummary> {heap
1788k}Streaming LTO
<analyzer>during IPA pass: analyzer
reproducer.c:13:1: internal compiler error: in process_worklist_item, at
analyzer/diagnostic-manager.cc:569
13 | }
| ^
GCC is fairly new on Rawhide:
$ rpm -q gcc
gcc-16.0.1-0.7.fc45.x86_64
$ gcc --version
gcc (GCC) 16.0.1 20260209 (Red Hat 16.0.1-0)