aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2025-03-07 17:17:24 +0100
committerMartin Jambor <jamborm@gcc.gnu.org>2025-03-07 17:25:07 +0100
commit7deb498425799aceb7659ea25614175a49533184 (patch)
tree211e35bfb8a1c11190557029b08cc460a1606f3c /gcc
parentb7f5d9114801716924a67ea393f0c30ab793e505 (diff)
downloadgcc-7deb498425799aceb7659ea25614175a49533184.zip
gcc-7deb498425799aceb7659ea25614175a49533184.tar.gz
gcc-7deb498425799aceb7659ea25614175a49533184.tar.bz2
ipa-cp: Avoid ICE when redistributing nodes among edges to recursive clones (PR 118318)
PR 118318 reported an ICE during PGO build of Firefox when IPA-CP, in the final stages of update_counts_for_self_gen_clones where it attempts to guess how to distribute profile count among clones created for recursive edges and the various edges that are created in the process. If one such edge has profile count of kind GUESSED_GLOBAL0, the compatibility check in the operator+ will lead to an ICE. After discussing the situation with Honza, we concluded that there is little more we can do other than check for this situation before touching the edge count, so this is what this patch does. gcc/ChangeLog: 2025-02-28 Martin Jambor <mjambor@suse.cz> PR ipa/118318 * ipa-cp.cc (adjust_clone_incoming_counts): Add a compatible_p check.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ipa-cp.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc
index 3c994f2..2645689 100644
--- a/gcc/ipa-cp.cc
+++ b/gcc/ipa-cp.cc
@@ -4638,7 +4638,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)