From 8398c9b3a4ecb0da3453edeb71395288eccab2b0 Mon Sep 17 00:00:00 2001 From: jamborm Date: Thu, 12 Sep 2013 15:20:05 +0000 Subject: 2013-09-12 Martin Jambor PR ipa/58389 * ipa-prop.c (remove_described_reference): Give up if the edge in the reference descriptor is NULL. (ipa_edge_removal_hook): If owning a reference descriptor, set its edge to NULL. testsuite/ * g++.dg/pr58389.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202532 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ipa-prop.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gcc/ipa-prop.c') 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)); -- cgit v1.2.1