]>
git.ipfire.org Git - thirdparty/gcc.git/commit
[PATCH] [AutoFDO/devirt] Fix ICE with duplicate speculative ID
This happens due to autoprofile pass makes edge make_speculative.
Then ipa-devirt does the same with the same speculative_id which
reults in duplicate speculative_id and ICE.
during IPA pass: cp
test.i:31:1: internal compiler error: verify_cgraph_node failed
0x39bfa6b internal_error(char const*, ...)
../../gcc/gcc/diagnostic-global-context.cc:787
0x13914eb cgraph_node::verify_node()
../../gcc/gcc/cgraph.cc:4454
0x13738ab symtab_node::verify()
../../gcc/gcc/symtab.cc:1377
0x1373d1b symtab_node::verify_symtab_nodes()
../../gcc/gcc/symtab.cc:1499
0x13a3653 symtab_node::checking_verify_symtab_nodes()
../../gcc/gcc/cgraph.h:718
0x182d267 symbol_table::remove_unreachable_nodes(_IO_FILE*)
../../gcc/gcc/ipa.cc:688
0x19f8c33 execute_todo
../../gcc/gcc/passes.cc:2163
We may also have to check if the speculative edge is present
before making speculative.
gcc/ChangeLog:
2025-12-22 Kugan Vivekanandarajah <kvivekananda@nvidia.com>
* cgraph.cc (cgraph_edge::get_next_speculative_id): New.
* cgraph.h (cgraph_edge::get_next_speculative_id): New.
* ipa-devirt.cc (ipa_devirt): Use get_next_speculative_id
in make_speculative.
Signed-off-by: Kugan Vivekanandarajah <kvivekananda@nvidia.com>