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]

[PATCH] Fix some memleaks


This patch fixes some memleaks found using valgrind.  Bootstrap
and regtest in progress, ok for mainline if it passes?

Thanks,
Richard.

Leaks left:

==29530== 30720 (22812 direct, 7908 indirect) bytes in 436 blocks are 
definitely lost in loss record 6 of 10
==29530==    at 0x1B8FF8A6: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck.so)
==29530==    by 0x86BD6CA: xmalloc (xmalloc.c:147)
==29530==    by 0x85BFB71: analyze_array (tree-data-ref.c:856)
==29530==    by 0x81818BE: infer_loop_bounds_from_undefined 
(tree-ssa-loop-niter.c:1437)
==29530==    by 0x81820D8: estimate_numbers_of_iterations_loop 
(tree-ssa-loop-niter.c:1547)
==29530==    by 0x8183412: scev_probably_wraps_p 
(tree-ssa-loop-niter.c:1964)
==29530==    by 0x85B1CE0: chrec_convert (tree-chrec.c:1145)
==29530==    by 0x85B7ACD: interpret_rhs_modify_expr 
(tree-scalar-evolution.c:1715)
==29530==    by 0x85B7D9D: analyze_scalar_evolution_1 
(tree-scalar-evolution.c:1799)
==29530==    by 0x85B7C9C: analyze_scalar_evolution_1 
(tree-scalar-evolution.c:1790)
==29530==    by 0x85B7ED9: analyze_scalar_evolution 
(tree-scalar-evolution.c:1856)
==29530==    by 0x818190C: infer_loop_bounds_from_undefined 
(tree-ssa-loop-niter.c:1449)

(DannyB is looking at this)


2005-09-15  Richard Guenther  <rguenther@suse.de>

	* ipa-pure-const.c (static_execute): Free auxiliar information.
	* ipa-type-escape.c (discover_unique_type): Free temporary key.
	* tree-vrp.c (remove_range_assertions): Free blocks_visited sbitmap.

Index: ipa-pure-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ipa-pure-const.c,v
retrieving revision 2.4
diff -c -3 -p -r2.4 ipa-pure-const.c
*** ipa-pure-const.c	31 Aug 2005 17:33:58 -0000	2.4
--- ipa-pure-const.c	15 Sep 2005 15:47:37 -0000
*************** static_execute (void)
*** 695,700 ****
--- 695,703 ----
      /* Get rid of the aux information.  */
      if (node->aux)
        {
+ 	w_info = node->aux;
+ 	if (w_info->aux)
+ 	  free (w_info->aux);
  	free (node->aux);
  	node->aux = NULL;
        }
Index: ipa-type-escape.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ipa-type-escape.c,v
retrieving revision 2.4
diff -c -3 -p -r2.4 ipa-type-escape.c
*** ipa-type-escape.c	1 Aug 2005 03:54:46 -0000	2.4
--- ipa-type-escape.c	15 Sep 2005 15:47:37 -0000
*************** discover_unique_type (tree type)
*** 250,255 ****
--- 250,256 ----
        }
      i++;
    } 
+   free (brand);
  }
  
  /* Return true if TYPE is one of the type classes that we are willing
Index: tree-vrp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-vrp.c,v
retrieving revision 2.56
diff -c -3 -p -r2.56 tree-vrp.c
*** tree-vrp.c	15 Sep 2005 05:03:01 -0000	2.56
--- tree-vrp.c	15 Sep 2005 15:47:37 -0000
*************** remove_range_assertions (void)
*** 2784,2789 ****
--- 2784,2791 ----
  	else
  	  bsi_next (&si);
        }
+ 
+   sbitmap_free (blocks_visited);
  }
  
  


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