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

Jakub Jelinek jakub@redhat.com
Wed Feb 27 15:58:00 GMT 2013


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?

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



More information about the Gcc-patches mailing list