https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128331
Bug ID: 128331
Summary: lto1: internal compiler error: in
remove_unreachable_nodes, at ipa.cc:593
Product: gcc
Version: 16.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: lto
Assignee: unassigned at gcc dot gnu.org
Reporter: wangqirui1996 at gmail dot com
Target Milestone: ---
Created attachment 66054
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=66054&action=edit
The mininal repro, 5 .ii files, most of the lines are from <string> standard
library
When compiling https://github.com/Smattr/rumur with flags `-O3 -flto` I get an
ICE. It does not happen with `-O2 -flto` or `-O3` only.
I stripped down the project to 5 files, and tested on both Archlinux (gcc
16.2.1 20260810) and `gcc:latest` docker image. Here is the error message from
`gcc:latest` docker:
# podman run --rm -v ./gcc-ice-lto-repro:/src:ro docker.io/library/gcc:latest
bash -c 'cp -a /src /tmp/src; cd /tmp/src; c++ -v; echo ========; c++
-march=x86-64 -O3 -flto=1 -fno-plt -fPIE Expr.ii traverse.ii TypeExpr.ii
parser_stub.ii main.min.ii -Wl,--unresolved-symbols=ignore-all'
Using built-in specs.
COLLECT_GCC=c++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-linux-gnu/16.2.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: /usr/src/gcc/configure --build=x86_64-linux-gnu
--disable-multilib --enable-languages=c,c++,fortran,go
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.2.0 (GCC)
========
during IPA pass: inline
lto1: internal compiler error: in remove_unreachable_nodes, at ipa.cc:593
0x210a236 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x21031ff internal_error(char const*, ...)
???:0
0x7ad229 fancy_abort(char const*, int, char const*)
???:0
/usr/local/libexec/gcc/x86_64-linux-gnu/16.2.0/lto1 -quiet -dumpbase ./a.wpa
-march=x86-64 -O3 -O3 -fno-openmp -fno-openacc -fcf-protection=none -fno-plt
-fPIE -fltrans-output-list=/tmp/ccuHwF1h.ltrans.out -fwpa
-fresolution=/tmp/ccmvBOMY.res -flinker-output=exec @/tmp/cc1iSs3B
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.
lto-wrapper: fatal error: c++ returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status