From dcd8fd01d0a151b20b65ea6bbef6590dc042f953 Mon Sep 17 00:00:00 2001
From: pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 2 Jan 2004 22:42:31 +0000
Subject: [PATCH] 2004-01-02  Andrew Pinski  <pinskia@physics.uc.edu>

        * c-typeck.c (finish_init): Free spelling_base before
        setting it again.

        * cfgloop.c (flow_loops_find): Always free the sbitmap
        headers.

        * predict.c (estimate_probability): Free bbs after being
        done with it.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75337 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog  | 11 +++++++++++
 gcc/c-typeck.c |  2 ++
 gcc/cfgloop.c  |  4 ++--
 gcc/predict.c  |  3 +++
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e387cbcd990f..80297cff20d8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2004-01-02  Andrew Pinski  <pinskia@physics.uc.edu>
+
+	* c-typeck.c (finish_init): Free spelling_base before 
+	setting it again.
+	
+	* cfgloop.c (flow_loops_find): Always free the sbitmap
+	headers.
+
+	* predict.c (estimate_probability): Free bbs after being
+	done with it.
+
 2004-01-02  Kazu Hirata  <kazu@cs.umass.edu>
 
 	* config/mn10300/mn10300.h (PREDICATE_CODES): Add
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 682cbc0585fd..3a71ee7f001a 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -4450,6 +4450,8 @@ finish_init (void)
     abort ();
 
   /* Pop back to the data of the outer initializer (if any).  */
+  free (spelling_base);
+  
   constructor_decl = p->decl;
   constructor_asmspec = p->asmspec;
   require_constant_value = p->require_constant_value;
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index 43c52f23ddb7..37cf8f450bf0 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -883,8 +883,6 @@ flow_loops_find (struct loops *loops, int flags)
 	  loop->num_nodes = flow_loop_nodes_find (loop->header, loop);
 	}
 
-      sbitmap_free (headers);
-
       /* Assign the loop nesting depth and enclosed loop level for each
 	 loop.  */
       loops->levels = flow_loops_level_compute (loops);
@@ -900,6 +898,8 @@ flow_loops_find (struct loops *loops, int flags)
       free_dominance_info (CDI_DOMINATORS);
     }
 
+  sbitmap_free (headers);
+
   loops->state = 0;
 #ifdef ENABLE_CHECKING
   verify_flow_info ();
diff --git a/gcc/predict.c b/gcc/predict.c
index 74a1f24c3ad5..0cba3a5f91e7 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -467,6 +467,9 @@ estimate_probability (struct loops *loops_info)
 		    - predictor_info [(int) PRED_LOOP_EXIT].hitrate)
 		   / exits);
 	}
+      
+      /* Free basic blocks from get_loop_body. */
+      free (bbs);
     }
 
   /* Attempt to predict conditional jumps using a number of heuristics.  */
-- 
GitLab