From 0ef96d745463552001d445a156eb6475c25b5af5 Mon Sep 17 00:00:00 2001 From: hubicka Date: Mon, 28 Oct 2019 08:19:56 +0000 Subject: [PATCH] PR ipa/92242 * ipa-fnsummary.c (ipa_merge_fn_summary_after_inlining): Check for missing EDGE_REF * ipa-prop.c (update_jump_functions_after_inlining): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@277504 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/ipa-fnsummary.c | 2 +- gcc/ipa-prop.c | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9511081cb581..9ef181f28374 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-10-25 Jan Hubicka + + PR ipa/92242 + * ipa-fnsummary.c (ipa_merge_fn_summary_after_inlining): Check + for missing EDGE_REF + * ipa-prop.c (update_jump_functions_after_inlining): Likewise. + 2019-10-25 Jiufu Guo PR tree-optimization/88760 diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c index ce384dfc9f0c..0d38e42546de 100644 --- a/gcc/ipa-fnsummary.c +++ b/gcc/ipa-fnsummary.c @@ -3315,7 +3315,7 @@ ipa_merge_fn_summary_after_inlining (struct cgraph_edge *edge) if (ipa_node_params_sum && callee_info->conds) { class ipa_edge_args *args = IPA_EDGE_REF (edge); - int count = ipa_get_cs_argument_count (args); + int count = args ? ipa_get_cs_argument_count (args) : 0; int i; if (count) diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index edab920e8f49..0dd735614191 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -2741,7 +2741,7 @@ update_jump_functions_after_inlining (struct cgraph_edge *cs, /* We must check range due to calls with variable number of arguments and we cannot combine jump functions with operations. */ if (dst->value.pass_through.operation == NOP_EXPR - && (dst->value.pass_through.formal_id + && (top && dst->value.pass_through.formal_id < ipa_get_cs_argument_count (top))) { int dst_fid = dst->value.pass_through.formal_id; @@ -3430,7 +3430,7 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs, continue; /* We must check range due to calls with variable number of arguments: */ - if (ici->param_index >= ipa_get_cs_argument_count (top)) + if (!top || ici->param_index >= ipa_get_cs_argument_count (top)) { ici->param_index = -1; continue; -- 2.47.2