This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix memory leak in ipa-reference (PR middle-end/56461)


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
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]