[PATCH] Fix ipa-cp memory leaks (PR middle-end/56461)

Richard Biener rguenther@suse.de
Wed Feb 27 19:51:00 GMT 2013


On 2/27/13 4:59 PM, Jakub Jelinek wrote:
> Hi!
> 
> known_aggs is freed/released in another function, but not in
> decide_whether_version_node, where it leaks memory.
> 
> Fixed thusly, 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-cp.c (decide_whether_version_node): Call vec_free on
> 	known_aggs[i].items and release known_aggs vector.
> 
> --- gcc/ipa-cp.c.jj	2013-02-21 22:24:12.000000000 +0100
> +++ gcc/ipa-cp.c	2013-02-27 09:25:48.557980184 +0100
> @@ -3406,6 +3406,9 @@ decide_whether_version_node (struct cgra
>        info = IPA_NODE_REF (node);
>        info->do_clone_for_all_contexts = false;
>        IPA_NODE_REF (clone)->is_all_contexts_clone = true;
> +      for (i = 0; i < count ; i++)
> +	vec_free (known_aggs[i].items);
> +      known_aggs.release ();
>        ret = true;
>      }
>    else
> 
> 	Jakub
> 



More information about the Gcc-patches mailing list