https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97295
--- Comment #6 from Sergei Trofimovich <slyfox at gcc dot gnu.org> --- Created attachment 49336 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49336&action=edit b.tar.gz Managed to craft self-contained example which is able to crash both gcc-10 and gcc-11. Attached as b.tar.gz. The session looks like: $ LANG=C bash -x ./mk2.bash + rm TestFloatingPoint.o Unified_cpp_mfbt0.o main.o Unified_cpp_mfbt0.gcda main.gcda main + cxx=g++-11.0.0 + cxxflags=(-flto -fPIC -O1 -Wno-error=coverage-mismatch -Wno-coverage-mismatch -Wno-missing-profile "$@") + g++-11.0.0 -flto -fPIC -O1 -Wno-error=coverage-mismatch -Wno-coverage-mismatch -Wno-missing-profile -o Unified_cpp_mfbt0.o -c -O1 -fprofile-generate -fprofile-correction Unified_cpp_mfbt0.cpp + g++-11.0.0 -flto -fPIC -O1 -Wno-error=coverage-mismatch -Wno-coverage-mismatch -Wno-missing-profile -o main.o -c -O1 -fprofile-generate -fprofile-correction main.cc + g++-11.0.0 -flto -fPIC -O1 -Wno-error=coverage-mismatch -Wno-coverage-mismatch -Wno-missing-profile -o main -O1 -fprofile-generate main.o Unified_cpp_mfbt0.o + ./main + g++-11.0.0 -flto -fPIC -O1 -Wno-error=coverage-mismatch -Wno-coverage-mismatch -Wno-missing-profile -o Unified_cpp_mfbt0.o -c -O1 -fprofile-use -fprofile-correction Unified_cpp_mfbt0.cpp + g++-11.0.0 -flto -fPIC -O1 -Wno-error=coverage-mismatch -Wno-coverage-mismatch -Wno-missing-profile -o TestFloatingPoint.o -c -O0 TestFloatingPoint.cpp + g++-11.0.0 -flto -fPIC -O1 -Wno-error=coverage-mismatch -Wno-coverage-mismatch -Wno-missing-profile -o TestFloatingPoint -O1 -shared TestFloatingPoint.o Unified_cpp_mfbt0.o during RTL pass: ira TestFloatingPoint.cpp: In function 'BitwiseCast': TestFloatingPoint.cpp:11:1: internal compiler error: in to_frequency, at profile-count.c:273 11 | } | ^ 0x5c6aaf profile_count::to_frequency(function*) const /usr/src/debug/sys-devel/gcc-11.0.0_pre9999/gcc-11.0.0_pre9999/gcc/profile-count.c:273 0x9f2511 regstat_bb_compute_ri /usr/src/debug/sys-devel/gcc-11.0.0_pre9999/gcc-11.0.0_pre9999/gcc/regstat.c:200 0x9f2511 regstat_compute_ri() /usr/src/debug/sys-devel/gcc-11.0.0_pre9999/gcc-11.0.0_pre9999/gcc/regstat.c:253 0x8b5680 ira /usr/src/debug/sys-devel/gcc-11.0.0_pre9999/gcc-11.0.0_pre9999/gcc/ira.c:5300 0x8b5680 execute /usr/src/debug/sys-devel/gcc-11.0.0_pre9999/gcc-11.0.0_pre9999/gcc/ira.c:5672 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://bugs.gentoo.org/> for instructions. lto-wrapper: fatal error: /usr/bin/g++-11.0.0 returned 1 exit status compilation terminated. /usr/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status