This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix memory leak in ipa-reference (PR middle-end/56461)
- From: Richard Biener <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 27 Feb 2013 20:50:52 +0100
- Subject: Re: [PATCH] Fix memory leak in ipa-reference (PR middle-end/56461)
- References: <20130227155818.GJ12913@tucnak.redhat.com>
On 2/27/13 4:58 PM, Jakub Jelinek wrote:
> Hi!
>
> Apparently even node->alias nodes can have reference vars info created,
> so we need to free it too.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
Ok.
Thanks,
Richard.
> 2013-02-27 Jakub Jelinek <jakub@redhat.com>
>
> PR middle-end/56461
> * ipa-reference.c (propagate): Free node_info even for alias nodes.
>
> --- gcc/ipa-reference.c.jj 2013-01-11 09:02:37.000000000 +0100
> +++ gcc/ipa-reference.c 2013-02-27 09:17:00.692004693 +0100
> @@ -834,12 +834,10 @@ propagate (void)
> ipa_reference_global_vars_info_t node_g;
> ipa_reference_optimization_summary_t opt;
>
> - if (node->alias)
> - continue;
> -
> node_info = get_reference_vars_info (node);
> - if (cgraph_function_body_availability (node) > AVAIL_OVERWRITABLE
> - || (flags_from_decl_or_type (node->symbol.decl) & ECF_LEAF))
> + if (!node->alias
> + && (cgraph_function_body_availability (node) > AVAIL_OVERWRITABLE
> + || (flags_from_decl_or_type (node->symbol.decl) & ECF_LEAF)))
> {
> node_g = &node_info->global;
>
>
> Jakub
>