diff options
author | Jan Hubicka <jh@suse.cz> | 2021-03-01 14:36:11 +0100 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2021-03-01 14:36:11 +0100 |
commit | 150bde36c119eff4b8a74667c9d728d6a8a5e8a1 (patch) | |
tree | 1c608b9fe0952a71b347dac958153f4836348b20 | |
parent | 074226d5aa86cd3de517014acfe34c7f69a2ccc7 (diff) | |
download | gcc-150bde36c119eff4b8a74667c9d728d6a8a5e8a1.zip gcc-150bde36c119eff4b8a74667c9d728d6a8a5e8a1.tar.gz gcc-150bde36c119eff4b8a74667c9d728d6a8a5e8a1.tar.bz2 |
Fix ICE in compute_fn_summary
PR ipa/98338
* ipa-fnsummary.c (compute_fn_summary): Fix sanity check.
-rw-r--r-- | gcc/ipa-fnsummary.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c index c3a25c5..18bbae1 100644 --- a/gcc/ipa-fnsummary.c +++ b/gcc/ipa-fnsummary.c @@ -3143,11 +3143,18 @@ compute_fn_summary (struct cgraph_node *node, bool early) info->estimated_stack_size = size_info->estimated_self_stack_size; /* Code above should compute exactly the same result as - ipa_update_overall_fn_summary but because computation happens in - different order the roundoff errors result in slight changes. */ + ipa_update_overall_fn_summary except for case when speculative + edges are present since these are accounted to size but not + self_size. Do not compare time since different order the roundoff + errors result in slight changes. */ ipa_update_overall_fn_summary (node); - /* In LTO mode we may have speculative edges set. */ - gcc_assert (in_lto_p || size_info->size == size_info->self_size); + if (flag_checking) + { + for (e = node->indirect_calls; e; e = e->next_callee) + if (e->speculative) + break; + gcc_assert (e || size_info->size == size_info->self_size); + } } |