https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118318
Martin Jambor <jamborm at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2025-02-28 Assignee|unassigned at gcc dot gnu.org |jamborm at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #17 from Martin Jambor <jamborm at gcc dot gnu.org> --- I am going to test and on Monday I'll propose the following change which should address it. After some discussions with Honza it became clear that testing ipa_p() is not enough and we need to do the full compatible_p test before attempting the update. diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc index 68959f2677b..a63463c2906 100644 --- a/gcc/ipa-cp.cc +++ b/gcc/ipa-cp.cc @@ -4599,7 +4599,8 @@ adjust_clone_incoming_counts (cgraph_node *node, cs->count = cs->count.combine_with_ipa_count (sum); } else if (!desc->processed_edges->contains (cs) - && cs->caller->clone_of == desc->orig) + && cs->caller->clone_of == desc->orig + && cs->count.compatible_p (desc->count)) { cs->count += desc->count; if (dump_file)