https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110601
Bug ID: 110601 Summary: [14 Regression] ICE on systemd-253.5: during GIMPLE pass: cunroll: internal compiler error: Segmentation fault in scale_loop_profile() Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: slyfox at gcc dot gnu.org Target Milestone: --- Noticed ICE on gcc-master r14-2396-g15bbf1826a01f5 when building systemd-253.5 cvise came up with this test: // $ cat bug.c int high_key_blocks[] = {0, 0}; int high_key_blocks_0_0; long test_key_bitmask_key; void log_object_internal(); void test_key() { _Bool found = 0; for (long i;;) for (long block = 0; block < sizeof(high_key_blocks) / sizeof(int) && !found; block++) for (i = high_key_blocks_0_0; i && !found; i++) if (test_key_bitmask_key) { log_object_internal(); found = 1; } } Crashing: $ gcc -c bug.c -o bug.o -O2 -Werror -Wall during GIMPLE pass: cunroll bug.c: In function 'test_key': bug.c:5:6: internal compiler error: Segmentation fault 5 | void test_key() { | ^~~~~~~~ 0xccc87f crash_signal ../../source/gcc/toplev.cc:314 0x85aafe fprintf /nix/store/2bhnayqiskhnif3nhs26kkai342dz4dz-glibc-2.37-8-dev/include/bits/stdio2.h:79 0x85aafe scale_loop_profile(loop*, profile_probability, long) ../../source/gcc/cfgloopmanip.cc:585 0xdfa332 try_unroll_loop_completely ../../source/gcc/tree-ssa-loop-ivcanon.cc:911 0xdfa332 canonicalize_loop_induction_variables ../../source/gcc/tree-ssa-loop-ivcanon.cc:1286 0xdfb667 tree_unroll_loops_completely_1 ../../source/gcc/tree-ssa-loop-ivcanon.cc:1429 0xdfb5be tree_unroll_loops_completely_1 ../../source/gcc/tree-ssa-loop-ivcanon.cc:1382 0xdfb5be tree_unroll_loops_completely_1 ../../source/gcc/tree-ssa-loop-ivcanon.cc:1382 0xdfb83b tree_unroll_loops_completely ../../source/gcc/tree-ssa-loop-ivcanon.cc:1478 0xdfbc3f execute ../../source/gcc/tree-ssa-loop-ivcanon.cc:1644 0xdfbc3f execute ../../source/gcc/tree-ssa-loop-ivcanon.cc:1634 $ gcc -v Using built-in specs. COLLECT_GCC=/<<NIX>>/gcc-14.0.0/bin/gcc COLLECT_LTO_WRAPPER=/<<NIX>>/gcc-14.0.0/libexec/gcc/x86_64-unknown-linux-gnu/14.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../source/configure --prefix=/<<NIX>>/gcc-14.0.0 --with-gmp-include=/<<NIX>>/gmp-6.2.1-dev/include --with-gmp-lib=/<<NIX>>/gmp-6.2.1/lib --with-mpfr-include=/<<NIX>>/mpfr-4.2.0-dev/include --with-mpfr-lib=/<<NIX>>/mpfr-4.2.0/lib --with-mpc=/<<NIX>>/libmpc-1.3.1 --with-native-system-header-dir=/<<NIX>>/glibc-2.37-8-dev/include --with-build-sysroot=/ --program-prefix= --enable-lto --disable-libstdcxx-pch --without-included-gettext --with-system-zlib --enable-checking=release --enable-static --enable-languages=c,c++ --disable-multilib --enable-plugin --disable-libcc1 --with-isl=/<<NIX>>/isl-0.20 --disable-bootstrap --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=x86_64-unknown-linux-gnu Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.0 99999999 (experimental) (GCC)