https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121206
Bug ID: 121206 Summary: [16 regression] Hang in ranger when building gromacs-2025.2 Product: gcc Version: 16.0 Status: UNCONFIRMED Keywords: compile-time-hog, memory-hog Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: sjames at gcc dot gnu.org Target Milestone: --- Created attachment 61925 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61925&action=edit bt.txt Originally reported downstream in Gentoo by toralf at https://bugs.gentoo.org/960345. ``` $ g++ -c gmx_bundle.cpp.ii -march=znver3 -O2 # completes in reasonable time $ g++ -c gmx_bundle.cpp.ii -march=znver3 -O3 # hangs, gobbling memory ``` After running for a few minutes: ``` #0 0x0000555687e53c39 in memcpy (__dest=0x7fff7183a3d0, __src=0x5556a7be9d78, __len=80) at /usr/include/bits/string_fortified.h:29 #1 wide_int_storage::wide_int_storage (this=<optimized out>, x=..., this=<optimized out>, x=...) at /usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/wide-int.h:1198 #2 generic_wide_int<wide_int_storage>::generic_wide_int (this=0x7fff7183a3d0) at /usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/wide-int.h:775 #3 irange::lower_bound (pair=0, this=0x7fff7183aba8) at /usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/value-range.h:1166 #4 irange::union_ (this=<optimized out>, v=...) at /usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/value-range.cc:1791 #5 0x0000555688510648 in value_range::union_ (this=0x7fff7183b120, r=...) at /usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/value-range.h:785 #6 ranger_cache::propagate_cache (this=0x5556a7974780, name=0x7fd1ee84a630) at /usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/gimple-range-cache.cc:1365 #7 0x000055568844a25e in ranger_cache::fill_block_cache (this=0x5556a7974780, name=<optimized out>, bb=<optimized out>, def_bb=0x7fd1eeaf9600) at /usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/gimple-range-cache.cc:1653 #8 0x000055568841a941 in ranger_cache::block_range (this=<optimized out>, r=..., bb=0x7fd1ee81d600, name=0x7fd1ee84a630, calc=true) at /usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/gimple-range-cache.cc:1313 #9 ranger_cache::block_range (this=<optimized out>, r=..., bb=<optimized out>, name=0x7fd1ee84a630, calc=true) at /usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/gimple-range-cache.cc:1281 #10 gimple_ranger::range_on_entry (this=0x5556a7974740, r=..., bb=0x7fd1ee81d600, name=0x7fd1ee84a630) at /usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/gimple-range.cc:174 #11 0x000055568835e282 in gimple_ranger::range_of_expr (this=0x5556a7974740, r=..., expr=0x7fd1ee84a630, stmt=<optimized out>) at /usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/gimple-range.cc:146 #12 0x0000555688408382 in fur_stmt::get_operand (this=0x7fff7183d0a0, r=..., expr=0x7fd1ee84a630) at /usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/gimple-range-fold.cc:143 #13 fold_using_range::range_of_range_op (this=this@entry=0x7fff7183d080, r=..., handler=..., src=...) at /usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/gimple-range-fold.cc:718 #14 0x0000555688badf1a in fold_using_range::fold_stmt(vrange&, gimple*, fur_source&, tree_node*) [clone .constprop.2] (this=0x7fff7183d080, r=..., s=0x7fd1ee81dc00, src=..., name=0x7fd1ee821168) at /usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/gimple-range-fold.cc:649 #15 0x00005556883f3e92 in gimple_ranger::fold_range_internal (this=0x5556a7974740, r=..., s=<optimized out>, name=<optimized out>) at /usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/gimple-range.cc:282 [...] ``` ``` Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/16/lto-wrapper 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-objc-gc --enable-languages=c,c++,d,objc,obj-c++,fortran,ada,cobol,m2,rust --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 37758405f27f9ebf31a0e59044da0c0aa9eda679' --with-gcc-major-version-only --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --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-offload-defaulted --enable-offload-targets=nvptx-none --enable-libgomp --disable-libssp --enable-libada --disable-cet --disable-systemtap --enable-valgrind-annotations --disable-vtable-verify --disable-libvtv --with-zstd --with-isl --disable-isl-version-check --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-linker-build-id --with-build-config='bootstrap-O3 bootstrap-lto' Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 16.0.0 20250718 (experimental) f880cfc2a4e9daa69f7bb3e64c584dde705783b0 (Gentoo Hardened 16.0.9999 p, commit 37758405f27f9ebf31a0e59044da0c0aa9eda679) ```