https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114601
Bug ID: 114601 Summary: ICE: SIGSEGV in hash_table_mod1 (hash-table.h:344) with -fcondition-coverage -finstrument-functions-once Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Target Milestone: --- Host: x86_64-pc-linux-gnu Target: x86_64-pc-linux-gnu This happens also after the PR114599 fix. Compiler output: $ cat testcase.c void foo() {} $ x86_64-pc-linux-gnu-gcc -fcondition-coverage -finstrument-functions-once testcase.c -wrapper valgrind,-q ==25248== Invalid read of size 4 ==25248== at 0x15FBA4A: hash_table_mod1 (hash-table.h:344) ==25248== by 0x15FBA4A: hash_table<hash_map<gcond*, unsigned int, simple_hashmap_traits<default_hash_traits<gcond*>, unsigned int> >::hash_entry, false, xcallocator>::find_with_hash(gcond* const&, unsigned int) (hash-table.h:985) ==25248== by 0x15F9C4B: get (hash-map.h:191) ==25248== by 0x15F9C4B: condition_uid (tree-profile.cc:370) ==25248== by 0x15F9C4B: find_conditions(function*) (tree-profile.cc:877) ==25248== by 0x140DBD3: branch_prob(bool) (profile.cc:1549) ==25248== by 0x15F92A4: tree_profiling (tree-profile.cc:1917) ==25248== by 0x15F92A4: (anonymous namespace)::pass_ipa_tree_profile::execute(function*) (tree-profile.cc:2046) ==25248== by 0x13D0F7A: execute_one_pass(opt_pass*) (passes.cc:2647) ==25248== by 0x13D2346: execute_ipa_pass_list(opt_pass*) (passes.cc:3096) ==25248== by 0xFCFEC7: ipa_passes (cgraphunit.cc:2214) ==25248== by 0xFCFEC7: symbol_table::compile() [clone .part.0] (cgraphunit.cc:2337) ==25248== by 0xFD2747: compile (cgraphunit.cc:2315) ==25248== by 0xFD2747: symbol_table::finalize_compilation_unit() (cgraphunit.cc:2589) ==25248== by 0x15135E1: compile_file() (toplev.cc:476) ==25248== by 0xDE841B: do_compile (toplev.cc:2154) ==25248== by 0xDE841B: toplev::main(int, char**) (toplev.cc:2310) ==25248== by 0xDE9BFA: main (main.cc:39) ==25248== Address 0x30 is not stack'd, malloc'd or (recently) free'd ==25248== during IPA pass: profile testcase.c: In function 'foo': testcase.c:1:1: internal compiler error: Segmentation fault 1 | void foo() {} | ^~~~ 0x15130ff crash_signal /repo/gcc-trunk/gcc/toplev.cc:319 0x15fba4a hash_table_mod1(unsigned int, unsigned int) /repo/gcc-trunk/gcc/hash-table.h:344 0x15fba4a hash_table<hash_map<gcond*, unsigned int, simple_hashmap_traits<default_hash_traits<gcond*>, unsigned int> >::hash_entry, false, xcallocator>::find_with_hash(gcond* const&, unsigned int) /repo/gcc-trunk/gcc/hash-table.h:985 0x15f9c4b hash_map<gcond*, unsigned int, simple_hashmap_traits<default_hash_traits<gcond*>, unsigned int> >::get(gcond* const&) /repo/gcc-trunk/gcc/hash-map.h:191 0x15f9c4b condition_uid /repo/gcc-trunk/gcc/tree-profile.cc:370 0x15f9c4b find_conditions(function*) /repo/gcc-trunk/gcc/tree-profile.cc:877 0x140dbd3 branch_prob(bool) /repo/gcc-trunk/gcc/profile.cc:1549 0x15f92a4 tree_profiling /repo/gcc-trunk/gcc/tree-profile.cc:1917 0x15f92a4 execute /repo/gcc-trunk/gcc/tree-profile.cc:2046 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. $ x86_64-pc-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-9803-20240405111321-g9ab8fdfeef5-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ --enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra --disable-bootstrap --with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld --with-as=/usr/bin/x86_64-pc-linux-gnu-as --enable-libsanitizer --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-r14-9803-20240405111321-g9ab8fdfeef5-checking-yes-rtl-df-extra-nobootstrap-amd64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 14.0.1 20240405 (experimental) (GCC)