https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98599
Bug ID: 98599
Summary: fatal error: Cgraph edge statement index out of range
with -Os -flto -fanalyzer
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: analyzer
Assignee: dmalcolm at gcc dot gnu.org
Reporter: acoplan at gcc dot gnu.org
Target Milestone: ---
The following fails:
$ cat test.c
int b(int);
int a() { b(5); }
int main() { a(); }
$ aarch64-elf-gcc -Os -flto -fanalyzer test.c
test.c: In function 'a':
test.c:3:5: fatal error: Cgraph edge statement index out of range
3 | int main() { a(); }
| ^
compilation terminated.
lto-wrapper: fatal error: aarch64-elf-gcc returned 1 exit status
compilation terminated.
/home/alecop01/toolchain/build-aarch64-elf/install/lib/gcc/aarch64-elf/11.0.0/../../../../aarch64-elf/bin/ld:
error: lto-wrapper failed
collect2: error: ld returned 1 exit status
Removing any one of these options prevents the error.