https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108500
Bug ID: 108500
Summary: -O -finline-small-functions results in "internal
compiler error: Segmentation fault" on a very large
program (700k function calls)
Product: gcc
Version: 12.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: dhekir at gmail dot com
Target Milestone: ---
Created attachment 54328
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54328&action=edit
compressed version of a simplified program causing the ICE
In the attached preprocessed program (compressed with .tar.gz), running
'gcc -O -finline-small-functions' results in:
gcc: internal compiler error: Segmentation fault signal terminated program cc1
The original program is more interesting than this simplified version. Still,
it does have more than 700k function calls in the main function, which is
causing the problem.
The original command line was simply 'gcc -O2', then I narrowed the options
down to -finline-small-functions.
I tried several GCC Docker images (running 'gcc -O2' on the attached file), and
I narrowed it down to:
- with gcc:10.4 (or older), compilation works without any errors;
- with gcc:11.1 (or newer; I tested up to 12.2.0), segmentation fault happens.