https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93313
Bug ID: 93313 Summary: g++: internal compiler error: Segmentation fault signal terminated program cc1plus Product: gcc Version: 9.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: herschel at hep dot phy.cam.ac.uk Target Milestone: --- I would like to report an apparent bug in the c++ compiler: the compiler segfaults when trying to compile my code, and it asks me to report the bug. I wrote my program to evaluate a large expression (a polynomial). For smaller expressions (200 KB), the program compiles without problems. However, for this large expression (23 MB), the compiler segfaults. The compiler isn't running out of RAM (it used only ~8GB before crashing, even on a machine with ~200 GB RAM). I have tried compiling on my laptop [gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2)] as well as on a server [gcc version 7.3.1 20180303 (Red Hat 7.3.1-5) (GCC)]. Here is the output of "gcc -v": Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:hsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.2.1-9ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2) Here is the command I used to try to compile my program: g++ myexample.cpp -o myexample -I/home/herschel/usr/include/firefly/ -L/home/herschel/usr/lib/firefly -lfirefly -lgmp -lz -lflint -lgmpxx -save-temps Here is the complete output from gcc: g++: internal compiler error: Segmentation fault signal terminated program cc1plus Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions. The pre-processed file "myexample.ii" is large (25MB), for the reasons explained at the start of this report. This makes it too large to include as an attachment, and I have instead uploaded it to: https://www.hep.phy.cam.ac.uk/~herschel/myexample.ii