From e806796de03b50f1b8cddaa6e0696ab652f268ef Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Fri, 3 Feb 2017 09:20:02 +0100 Subject: Fix memory leaks in IPA CP (PR ipa/79337). 2017-02-03 Martin Liska PR ipa/79337 * ipa-prop.c (ipa_node_params_t::insert): Remove current implementation. (ipa_node_params_t::remove): Likewise. * ipa-prop.h (ipa_node_params::ipa_node_params): Make default initialization from removed ipa_node_params_t::insert. (ipa_node_params::~ipa_node_params): Move from removed ipa_node_params_t::release. * symbol-summary.h (symbol_summary::m_released): New member. Do not release a summary twice. Do not allow to call finalizer for types of a summary that live in GGC memory. From-SVN: r245145 --- gcc/ipa-prop.c | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'gcc/ipa-prop.c') diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 3ef3d4f..d031a70 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -3736,38 +3736,6 @@ ipa_add_new_function (cgraph_node *node, void *data ATTRIBUTE_UNUSED) ipa_analyze_node (node); } -/* Initialize a newly created param info. */ - -void -ipa_node_params_t::insert (cgraph_node *, ipa_node_params *info) -{ - info->lattices = NULL; - info->ipcp_orig_node = NULL; - info->known_csts = vNULL; - info->known_contexts = vNULL; - info->analysis_done = 0; - info->node_enqueued = 0; - info->do_clone_for_all_contexts = 0; - info->is_all_contexts_clone = 0; - info->node_dead = 0; - info->node_within_scc = 0; - info->node_calling_single_call = 0; - info->versionable = 0; -} - -/* Frees all dynamically allocated structures that the param info points - to. */ - -void -ipa_node_params_t::remove (cgraph_node *, ipa_node_params *info) -{ - free (info->lattices); - /* Lattice values and their sources are deallocated with their alocation - pool. */ - info->known_csts.release (); - info->known_contexts.release (); -} - /* Hook that is called by summary when a node is duplicated. */ void -- cgit v1.1