https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123517
Bug ID: 123517
Summary: [16 regression]
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: build, compile-time-hog
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: sjames at gcc dot gnu.org
Target Milestone: ---
Bootstrap (on one system only so far, not narrowed down how to repro yet, will
do next) hangs for me when compiling libgcc/libgcov-interface.c (and a bunch of
other libgcc files).
```
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/build/./gcc/xgcc
-B/var/tmp/portage/sys-devel/gcc-16.0.9999/work/build/./gcc/
-B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/../lib/
-isystem /usr/x86_64-pc-linux-gnu/include -isystem
/usr/x86_64-pc-linux-gnu/sys-include -fno-checking -g -O2 -O3 -march=native
-fno-semantic-interposition -mtls-dialect=gnu2 -fdiagnostics-color=always
-Wa,-O2 -Wa,-mtune=znver4 -ggdb3 -pipe -Werror=strict-aliasing
-Werror=lto-type-mismatch -Werror=odr -fdiagnostics-color=always
-fdiagnostics-urls=never --param=ggc-min-expand=150 -ggdb3 -m32 -O2 -g -O2 -O3
-march=native -fno-semantic-interposition -mtls-dialect=gnu2
-fdiagnostics-color=always -Wa,-O2 -Wa,-mtune=znver4 -ggdb3 -pipe
-Werror=strict-aliasing -Werror=lto-type-mismatch -Werror=odr
-fdiagnostics-color=always -fdiagnostics-urls=never --param=ggc-min-expand=150
-ggdb3 -DIN_GCC -W -Wall -Wno-error=narrowing -Wwrite-strings -Wcast-qual
-Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include -fpic -mlong-double-80 -DUSE_ELF_SYMVER -fcf-protection
-mshstk -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector
-fno-stack-clash-protection -fpic -mlong-double-80 -DUSE_ELF_SYMVER
-fcf-protection -mshstk -I. -I. -I../../.././gcc
-I/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/libgcc
-I/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/libgcc/.
-I/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/libgcc/../gcc
-I/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/libgcc/../include
-I/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/libgcc/config/i386
-I/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/libgcc/config/libbid
-DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS -o _gcov_execl.o -MT
_gcov_execl.o -MD -MP -MF _gcov_execl.dep -DL_gcov_execl -c
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/libgcc/libgcov-interface.c
```
If I append -fno-ext-dce, it completes immediately.
```
0x00005568c3c5e668 in bitmap_ior_into (a=0x5568d62e5b98, b=<optimized out>) at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/bitmap.cc:2129
2129 if (!a_elt || a_elt->indx == b_elt->indx)
(gdb) bt
#0 0x00005568c3c5e668 in bitmap_ior_into (a=0x5568d62e5b98, b=<optimized out>)
at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/bitmap.cc:2129
#1 0x00005568c5c6eba8 in ext_dce_rd_transfer_n (bb_index=2) at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/ext-dce.cc:1307
#2 0x00005568c3d5642a in df_worklist_propagate_backward
(dataflow=dataflow@entry=0x5568c768de20 <user_dflow>,
bb_index=bb_index@entry=2,
bbindex_to_postorder=bbindex_to_postorder@entry=0x5568d6386340,
worklist=worklist@entry=0x5568d6460ba8, pending=pending@entry=0x5568d6460c18,
considered=considered@entry=0x5568d636db90, last_change_age=...,
age=<optimized out>) at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/df-core.cc:974
#3 0x00005568c3d58126 in df_worklist_dataflow_doublequeue (dataflow=<optimized
out>, considered=<optimized out>, blocks_in_postorder=<optimized out>,
bbindex_to_postorder=<optimized out>, n_blocks=<optimized out>) at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/df-core.cc:1090
#4 df_worklist_dataflow (dataflow=0x5568c768de20 <user_dflow>,
blocks_to_consider=<optimized out>, blocks_in_postorder=0x5568d64d01b0,
n_blocks=<optimized out>)
at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/df-core.cc:1163
#5 0x00005568c5c6ef1b in ext_dce_execute () at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/ext-dce.cc:1349
#6 ext_dce_execute () at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/ext-dce.cc:1324
#7 0x00005568c5c6fadd in (anonymous namespace)::pass_ext_dce::execute
(this=<optimized out>) at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/ext-dce.cc:1389
#8 0x00005568c43199ab in execute_one_pass (pass=0x5568d6249510) at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/passes.cc:2656
#9 0x00005568c431a7bc in execute_pass_list_1 (pass=0x5568d6249510) at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/passes.cc:2769
#10 0x00005568c431acc8 in execute_pass_list_1 (pass=0x5568d6248840) at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/passes.cc:2770
#11 execute_pass_list (fn=0x7fd3f1a95320, pass=<optimized out>) at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/passes.cc:2780
#12 0x00005568c3d29dcf in cgraph_node::expand (this=0x7fd3f1a98220) at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/context.h:49
#13 0x00005568c3d2d179 in expand_all_functions () at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/cgraphunit.cc:2052
#14 symbol_table::compile (this=this@entry=0x7fd3f2606000) at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/cgraphunit.cc:2430
#15 0x00005568c3d2fa3e in symbol_table::compile (this=0x7fd3f2606000) at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/cgraphunit.cc:2340
#16 symbol_table::finalize_compilation_unit (this=0x7fd3f2606000) at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/cgraphunit.cc:2619
#17 0x00005568c44fb60c in compile_file () at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/toplev.cc:482
#18 0x00005568c3a76282 in do_compile () at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/toplev.cc:2229
#19 toplev::main (this=this@entry=0x7ffe1399a546, argc=<optimized out>,
argc@entry=221, argv=<optimized out>, argv@entry=0x7ffe1399a678)
at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/toplev.cc:2394
#20 0x00005568c3a7825d in main (argc=221, argv=0x7ffe1399a678) at
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/main.cc:39
```
This machine last built fine at r16-6644-g9a2402ad31db75 and fails at
r16-6673-g1f7e64d56bce2c.
```
Using built-in specs.
COLLECT_GCC=/var/tmp/portage/sys-devel/gcc-16.0.9999/work/build/./gcc/xgcc
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/16
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/16/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/16/python
--enable-libphobos --enable-languages=c,c++,d,fortran,ada,jit --enable-obsolete
--enable-secureplt --disable-werror --with-system-zlib --enable-nls
--without-included-gettext --disable-libunwind-exceptions
--enable-checking=yes,extra,rtl --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo Hardened 16.0.9999 p, commit
90d9d881f2e83f884cbf8b26b0c4c4f473bc3372' --with-gcc-major-version-only
--enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--with-tls=gnu2 --enable-multilib --with-multilib-list=m32,m64
--disable-fixed-point --enable-targets=all --enable-offload-defaulted
--enable-offload-targets=nvptx-none --enable-libgomp --disable-libssp
--enable-libada --enable-cet --enable-systemtap --disable-valgrind-annotations
--disable-valgrind-interop --disable-vtable-verify --disable-libvtv --with-zstd
--without-isl --enable-default-pie --enable-host-pie --enable-host-bind-now
--enable-default-ssp --disable-fixincludes
--with-gxx-libcxx-include-dir=/usr/include/c++/v1 --enable-host-shared
--enable-libgdiagnostics --enable-linker-build-id
--with-build-config='bootstrap-O3 bootstrap-cet'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20260110 (experimental)
1f7e64d56bce2c51bbc093a3dfb1778eaddf12ee (Gentoo Hardened 16.0.9999 p, commit
90d9d881f2e83f884cbf8b26b0c4c4f473bc3372)
```