conflict.c (conflict_graph_compute): Free regsets when finished.
authorMichael Hayes <m.hayes@elec.canterbury.ac.nz>
Sat, 12 Jan 2002 04:14:50 +0000 (04:14 +0000)
committerMichael Hayes <m.hayes@gcc.gnu.org>
Sat, 12 Jan 2002 04:14:50 +0000 (04:14 +0000)
* conflict.c (conflict_graph_compute): Free regsets when finished.
* ssa.c (compute_coalesced_reg_partition): Likewise.

From-SVN: r48792

gcc/ChangeLog
gcc/conflict.c
gcc/ssa.c

index 0046e6ecfd4ab56b724713254f40bf0d95783dff..4f07be04a5bddf90ba55c52dcd41e541da2b73d0 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-12  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
+
+       * conflict.c (conflict_graph_compute): Free regsets when finished.
+       * ssa.c (compute_coalesced_reg_partition): Likewise.
+       
 2002-01-12  Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
 
        * global.c (find_reg): Check for HARD_REGNO_CALL_PART_CLOBBERED
index 99cd9ca1efad7013b98da2f987e9f1a330a589b9..d1fb1293cf9f142f1bc8020201029bdb56bf389a 100644 (file)
@@ -449,20 +449,20 @@ conflict_graph_compute (regs, p)
 {
   int b;
   conflict_graph graph = conflict_graph_new (max_reg_num ());
+  regset_head live_head;
+  regset live = &live_head;
+  regset_head born_head;
+  regset born = &born_head;
+
+  INIT_REG_SET (live);
+  INIT_REG_SET (born);
 
   for (b = n_basic_blocks; --b >= 0; )
     {
       basic_block bb = BASIC_BLOCK (b);
-      regset_head live_head;
-      regset live = &live_head;
-      regset_head born_head;
-      regset born = &born_head;
       rtx insn;
       rtx head;
 
-      INIT_REG_SET (live);
-      INIT_REG_SET (born);
-
       /* Start with the regs that are live on exit, limited to those
         we're interested in.  */
       COPY_REG_SET (live, bb->global_live_at_end);
@@ -524,5 +524,8 @@ conflict_graph_compute (regs, p)
        }
     }
 
+  FREE_REG_SET (live);
+  FREE_REG_SET (born);
+
   return graph;
 }
index bb7170602af633abfae952122013c3bd7462b751..503d1a74f6d29c4ff05663b6f22b24c965793456 100644 (file)
--- a/gcc/ssa.c
+++ b/gcc/ssa.c
@@ -1850,6 +1850,8 @@ compute_coalesced_reg_partition ()
 {
   int bb;
   int changed = 0;
+  regset_head phi_set_head;
+  regset phi_set = &phi_set_head;
 
   partition p = 
     partition_new (ssa_definition->num_elements);
@@ -1861,20 +1863,21 @@ compute_coalesced_reg_partition ()
   for (bb = n_basic_blocks; --bb >= 0; )
     make_regs_equivalent_over_bad_edges (bb, p);
 
+  INIT_REG_SET (phi_set);
+
   do
     {
-      regset_head phi_set;
       conflict_graph conflicts;
 
       changed = 0;
 
       /* Build the set of registers involved in phi nodes, either as
         arguments to the phi function or as the target of a set.  */
-      INITIALIZE_REG_SET (phi_set);
-      mark_phi_and_copy_regs (&phi_set);
+      CLEAR_REG_SET (phi_set);
+      mark_phi_and_copy_regs (phi_set);
 
       /* Compute conflicts.  */
-      conflicts = conflict_graph_compute (&phi_set, p);
+      conflicts = conflict_graph_compute (phi_set, p);
 
       /* FIXME: Better would be to process most frequently executed
         blocks first, so that most frequently executed copies would
@@ -1892,6 +1895,8 @@ compute_coalesced_reg_partition ()
     }
   while (changed > 0);
 
+  FREE_REG_SET (phi_set);
+
   return p;
 }