https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97295
Bug ID: 97295 Summary: ICE on firefox built with lto+pgo: dist/include/mozilla/Casting.h:64:1: internal compiler error: in to_frequency, at profile-count.c:273 Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: slyfox at gcc dot gnu.org Target Milestone: --- It's an upstream report of downstream bug https://bugs.gentoo.org/746578 where firefox-81.0 built with gcc-9.3.0 or gcc-10.2.0 ICEs on LTO+PGO build: The crash happens somewhere in register allocator: """ $ LANG=C g++-10.2.0 -o TestFloatingPoint TestFloatingPoint.o Unified_cpp_mfbt0.o -shared during RTL pass: ira /var/tmp/portage/www-client/firefox-81.0.1/work/firefox_build/dist/include/mozilla/Casting.h: In function 'BitwiseCast': /var/tmp/portage/www-client/firefox-81.0.1/work/firefox_build/dist/include/mozilla/Casting.h:64:1: internal compiler error: in to_frequency, at profile-count.c:273 0x5b0db1 profile_count::to_frequency(function*) const /usr/src/debug/sys-devel/gcc-10.2.0-r2/gcc-10.2.0/gcc/profile-count.c:273 0x9edea9 regstat_bb_compute_ri /usr/src/debug/sys-devel/gcc-10.2.0-r2/gcc-10.2.0/gcc/regstat.c:200 0x9edea9 regstat_compute_ri() /usr/src/debug/sys-devel/gcc-10.2.0-r2/gcc-10.2.0/gcc/regstat.c:253 0x8a5958 ira /usr/src/debug/sys-devel/gcc-10.2.0-r2/gcc-10.2.0/gcc/ira.c:5294 0x8a5958 execute /usr/src/debug/sys-devel/gcc-10.2.0-r2/gcc-10.2.0/gcc/ira.c:5666 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++-10.2.0 returned 1 exit status compilation terminated. /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status """ $ LANG=C g++-10.2.0 -v Using built-in specs. COLLECT_GCC=/usr/bin/g++-10.2.0 COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-10.2.0-r2/work/gcc-10.2.0/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/10.2.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/10.2.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/10.2.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/g++-v10 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/10.2.0/python --enable-languages=c,c++,go,jit,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 10.2.0-r2 p3' --disable-esp --enable-libstdcxx-time --enable-host-shared --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp --disable-libada --disable-systemtap --enable-vtable-verify --without-zstd --enable-lto --with-isl --disable-isl-version-check --enable-default-pie --enable-default-ssp Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.2.0 (Gentoo 10.2.0-r2 p3)