diff options
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r-- | gcc/ipa-prop.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index a0eea86fc0a..9054d906582 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -2506,6 +2506,8 @@ remove_described_reference (symtab_node symbol, struct ipa_cst_ref_desc *rdesc) struct cgraph_edge *origin; origin = rdesc->cs; + if (!origin) + return false; to_del = ipa_find_reference ((symtab_node) origin->caller, symbol, origin->call_stmt, origin->lto_stmt_uid); if (!to_del) @@ -3019,7 +3021,14 @@ ipa_edge_removal_hook (struct cgraph_edge *cs, void *data ATTRIBUTE_UNUSED) struct ipa_jump_func *jf; int i; FOR_EACH_VEC_ELT (*args->jump_functions, i, jf) - try_decrement_rdesc_refcount (jf); + { + struct ipa_cst_ref_desc *rdesc; + try_decrement_rdesc_refcount (jf); + if (jf->type == IPA_JF_CONST + && (rdesc = ipa_get_jf_constant_rdesc (jf)) + && rdesc->cs == cs) + rdesc->cs = NULL; + } } ipa_free_edge_args_substructures (IPA_EDGE_REF (cs)); |