diff options
author | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-12 15:20:05 +0000 |
---|---|---|
committer | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-12 15:20:05 +0000 |
commit | 8398c9b3a4ecb0da3453edeb71395288eccab2b0 (patch) | |
tree | f007460dfeaf58b393da5b3e56c4d0f470b53ff5 /gcc/ipa-prop.c | |
parent | 60f603c6f7406c179114ead9fe7bfbe0dd944c9a (diff) | |
download | gcc-8398c9b3a4ecb0da3453edeb71395288eccab2b0.tar.gz |
2013-09-12 Martin Jambor <mjambor@suse.cz>
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
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)); |