https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111495
Bug ID: 111495 Summary: [14 regression] ICE in lower_bound, at value-range.h:1078 when building LLVM 17.0.1 Product: gcc Version: 14.0 Status: UNCONFIRMED 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 55947 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55947&action=edit InstructionSimplify.cpp.ii ``` Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-unknown-linux-gnu/14/lto-wrapper Target: aarch64-unknown-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-14.0.0.9999/work/gcc-14.0.0.9999/configure --host=aarch64-unknown-linux-gnu --build=aarch64-unknown-linux-gnu --prefix=/usr --bindir=/usr/aarch64-unknown-linux-gnu/gcc-bin/14 --includedir=/usr/lib/gcc/aarch64-unknown-linux-gnu/14/include --datadir=/usr/share/gcc-data/aarch64-unknown-linux-gnu/14 --mandir=/usr/share/gcc-data/aarch64-unknown-linux-gnu/14/man --infodir=/usr/share/gcc-data/aarch64-unknown-linux-gnu/14/info --with-gxx-include-dir=/usr/lib/gcc/aarch64-unknown-linux-gnu/14/include/g++-v14 --disable-silent-rules --disable-dependency-tracking --with-python-dir=/share/gcc-data/aarch64-unknown-linux-gnu/14/python --enable-languages=c,c++,fortran --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 14.0.0 p, commit d0b55776a4e1d2f293db5ba0e4a04aefed055ec4' --with-gcc-major-version-only --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --disable-fixed-point --enable-libgomp --disable-libssp --disable-libada --disable-cet --disable-systemtap --disable-valgrind-annotations --disable-vtable-verify --disable-libvtv --with-zstd --without-isl --enable-default-pie --enable-host-pie --disable-host-bind-now --enable-default-ssp Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 14.0.0 20230920 (experimental) 2e36eedb244badaaf2a70388071115c851b8db9b (Gentoo 14.0.0 p, commit d0b55776a4e1d2f293db5ba0e4a04aefed055ec4) ``` ``` FAILED: lib/Analysis/CMakeFiles/LLVMAnalysis.dir/InstructionSimplify.cpp.o /usr/bin/aarch64-unknown-linux-gnu-g++ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/tmp/portage/sys-devel/llvm-17.0.1/work/llvm_build-.arm64/lib/Analysis -I/var/tmp/portage/sys-devel/llvm-17.0.1/work/llvm/lib/Analysis -I/var/tmp/portage/sys-devel/llvm-17.0.1/work/llvm_build-.arm64/include -I/var/tmp/portage/sys-devel/llvm-17.0.1/work/llvm/include -DNDEBUG -O3 -pipe -mcpu=native -fdiagnostics-color=always -ggdb3 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -std=c++17 -fdiagnostics-color=always -MD -MT lib/Analysis/CMakeFiles/LLVMAnalysis.dir/InstructionSimplify.cpp.o -MF lib/Analysis/CMakeFiles/LLVMAnalysis.dir/InstructionSimplify.cpp.o.d -o lib/Analysis/CMakeFiles/LLVMAnalysis.dir/InstructionSimplify.cpp.o -c /var/tmp/portage/sys-devel/llvm-17.0.1/work/llvm/lib/Analysis/InstructionSimplify.cpp during GIMPLE pass: vrp /var/tmp/portage/sys-devel/llvm-17.0.1/work/llvm/lib/Analysis/InstructionSimplify.cpp: In function ‘llvm::Value* simplifyInstructionWithOperands(llvm::Instruction*, llvm::ArrayRef<llvm::Value*>, const llvm::SimplifyQuery&, unsigned int)’: /var/tmp/portage/sys-devel/llvm-17.0.1/work/llvm/lib/Analysis/InstructionSimplify.cpp:6809:15: internal compiler error: in lower_bound, at value-range.h:1078 6809 | static Value *simplifyInstructionWithOperands(Instruction *I, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 0xaaaaae7fa197 irange::lower_bound(unsigned int) const /usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/value-range.h:1078 0xaaaaae7fa197 gimple_simplify_EXACT_DIV_EXPR(gimple_match_op*, gimple**, tree_node* (*)(tree_node*), code_helper, tree_node*, tree_node*, tree_node*) /usr/src/debug/sys-devel/gcc-14.0.0.9999/build/gcc/gimple-match-2.cc:8278 0xaaaaadcbc307 gimple_resimplify2 /usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/gimple-match-exports.cc:1001 0xaaaaadcbcf2f gimple_simplify(gimple*, gimple_match_op*, gimple**, tree_node* (*)(tree_node*), tree_node* (*)(tree_node*)) /usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/gimple-match-exports.cc:868 0xaaaaad1fa8b7 fold_stmt_1 /usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/gimple-fold.cc:6355 0xaaaaae56b1c7 gimple_ranger::fold_stmt(gimple_stmt_iterator*, tree_node* (*)(tree_node*)) /usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/gimple-range.cc:470 0xaaaaad94be7b rvrp_folder::fold_stmt(gimple_stmt_iterator*) /usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/tree-vrp.cc:1032 0xaaaaad82107b substitute_and_fold_dom_walker::before_dom_children(basic_block_def*) /usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/tree-ssa-propagate.cc:876 0xaaaaae51619b dom_walker::walk(basic_block_def*) /usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/domwalk.cc:311 0xaaaaad8200bf substitute_and_fold_engine::substitute_and_fold(basic_block_def*) /usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/tree-ssa-propagate.cc:999 0xaaaaad948a0f execute_ranger_vrp(function*, bool, bool) /usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/tree-vrp.cc:1062 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://bugs.gentoo.org/> for instructions. ``` Might be a dupe of PR111482. Maybe the test case is still useful if it is. I can reproduce with just 'g++ -c InstructionSimplify.cpp.ii -O3'.