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]

[tree-ssa]: Fix PTA memory leak


When I switched off interprocedural mode, i didn't make the necessary
changes so that we free the memory we can when not in interprocedural
mode.

Duh.

Bootstrapped and regtested on i686-pc-linux-gnu.

2004-02-04  Daniel Berlin  <dberlin@dberlin.org>

	* tree-alias-ander.c (andersen_init): Reorder/Redo code so that we
	actually free the memory in intraprocedural mode.
	(andersen_cleanup): Ditto.
Index: tree-alias-ander.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-alias-ander.c,v
retrieving revision 1.1.2.27
diff -u -3 -p -r1.1.2.27 tree-alias-ander.c
--- tree-alias-ander.c	20 Jan 2004 18:23:04 -0000	1.1.2.27
+++ tree-alias-ander.c	5 Feb 2004 15:44:28 -0000
@@ -433,7 +433,12 @@ static int initted = 0;
 static void
 andersen_init (struct tree_alias_ops *ops ATTRIBUTE_UNUSED)
 {
-  if (!initted || !flag_unit_at_a_time)
+#if 0
+  /* Don't claim we can do ip partial unless we have unit_at_a_time on. */
+  if (!flag_unit_at_a_time)
+#endif
+    andersen_ops.ip_partial = 0;
+  if (!initted || (!andersen_ops.ip_partial && !andersen_ops.ip))
     {
       pta_init ();
       andersen_rgn = newregion ();
@@ -442,11 +447,6 @@ andersen_init (struct tree_alias_ops *op

   ptamap = splay_tree_new (splay_tree_compare_pointers, NULL, NULL);

-#if 0
-  /* Don't claim we can do ip partial unless we have unit_at_a_time on. */
-  if (!flag_unit_at_a_time)
-#endif
-    andersen_ops.ip_partial = 0;
 }

 static int
@@ -477,7 +477,7 @@ andersen_cleanup (struct tree_alias_ops

   splay_tree_delete (ptamap);

-  if (!flag_unit_at_a_time)
+  if (!andersen_ops.ip_partial && !andersen_ops.ip)
     {
       pta_reset ();
       deleteregion (andersen_rgn);


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