OSDN Git Service

* cfg.c (clear_aux_for_blocks): Split out of ...
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Oct 2001 07:49:34 +0000 (07:49 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Oct 2001 07:49:34 +0000 (07:49 +0000)
        (free_aux_for_blocks): here.
        (clear_aux_for_edges): Split from ...
        (free_aux_for_edges): here.
        * basic-block.h: Declare them.
        * lcm.c (compute_antinout_edge): Use them.
        (compute_laterin, compute_available, compute_nearerout): Likewise.
        (optimize_mode_switching): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46534 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/basic-block.h
gcc/cfg.c
gcc/lcm.c

index bbff29b..57c5f76 100644 (file)
@@ -1,5 +1,16 @@
 2001-10-26  Richard Henderson  <rth@redhat.com>
 
+       * cfg.c (clear_aux_for_blocks): Split out of ...
+       (free_aux_for_blocks): here.
+       (clear_aux_for_edges): Split from ...
+       (free_aux_for_edges): here.
+       * basic-block.h: Declare them.
+       * lcm.c (compute_antinout_edge): Use them.
+       (compute_laterin, compute_available, compute_nearerout): Likewise.
+       (optimize_mode_switching): Likewise.
+
+2001-10-26  Richard Henderson  <rth@redhat.com>
+
        * Makefile.in (unstage*): Remove as, ld, collect-ld before
        moving everything back to the main build directory.
 
index cca96a3..6430230 100644 (file)
@@ -649,9 +649,11 @@ extern void flow_edge_list_print   PARAMS ((const char *, const edge *,
                                                 int, FILE *));
 extern void alloc_aux_for_block                PARAMS ((basic_block, int));
 extern void alloc_aux_for_blocks       PARAMS ((int));
+extern void clear_aux_for_blocks       PARAMS ((void));
 extern void free_aux_for_blocks                PARAMS ((void));
 extern void alloc_aux_for_edge         PARAMS ((edge, int));
 extern void alloc_aux_for_edges                PARAMS ((int));
+extern void clear_aux_for_edges                PARAMS ((void));
 extern void free_aux_for_edges         PARAMS ((void));
 
 /* This function is always defined so it can be called from the
index a720673..e767732 100644 (file)
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -618,22 +618,31 @@ alloc_aux_for_blocks (size)
     }
 }
 
-/* Free data allocated in block_aux_obstack and clear AUX pointers
-   of all blocks.  */
+/* Clear AUX pointers of all blocks.  */
 
 void
-free_aux_for_blocks ()
+clear_aux_for_blocks ()
 {
   int i;
 
-  if (!first_block_aux_obj)
-    abort ();
-  obstack_free (&block_aux_obstack, first_block_aux_obj);
   for (i = 0; i < n_basic_blocks; i++)
     BASIC_BLOCK (i)->aux = NULL;
   ENTRY_BLOCK_PTR->aux = NULL;
   EXIT_BLOCK_PTR->aux = NULL;
+}
+
+/* Free data allocated in block_aux_obstack and clear AUX pointers
+   of all blocks.  */
+
+void
+free_aux_for_blocks ()
+{
+  if (!first_block_aux_obj)
+    abort ();
+  obstack_free (&block_aux_obstack, first_block_aux_obj);
   first_block_aux_obj = NULL;
+
+  clear_aux_for_blocks ();
 }
 
 /* Allocate an memory edge of SIZE as BB->aux.  The obstack must
@@ -687,17 +696,13 @@ alloc_aux_for_edges (size)
     }
 }
 
-/* Free data allocated in edge_aux_obstack and clear AUX pointers
-   of all edges.  */
+/* Clear AUX pointers of all edges.  */
 
 void
-free_aux_for_edges ()
+clear_aux_for_edges ()
 {
   int i;
 
-  if (!first_edge_aux_obj)
-    abort ();
-  obstack_free (&edge_aux_obstack, first_edge_aux_obj);
   for (i = -1; i < n_basic_blocks; i++)
     {
       basic_block bb;
@@ -710,5 +715,18 @@ free_aux_for_edges ()
       for (e = bb->succ; e; e = e->succ_next)
        e->aux = NULL;
     }
+}
+
+/* Free data allocated in edge_aux_obstack and clear AUX pointers
+   of all edges.  */
+
+void
+free_aux_for_edges ()
+{
+  if (!first_edge_aux_obj)
+    abort ();
+  obstack_free (&edge_aux_obstack, first_edge_aux_obj);
   first_edge_aux_obj = NULL;
+
+  clear_aux_for_edges ();
 }
index 62572b8..4f5d692 100644 (file)
--- a/gcc/lcm.c
+++ b/gcc/lcm.c
@@ -177,6 +177,8 @@ compute_antinout_edge (antloc, transp, antin, antout)
            }
     }
 
+  clear_aux_for_edges ();
+  clear_aux_for_blocks ();
   free (worklist);
 }
 
@@ -354,6 +356,7 @@ compute_laterin (edge_list, earliest, antloc, later, laterin)
                     laterin[n_basic_blocks],
                     later[(size_t) e->aux]);
 
+  clear_aux_for_edges ();
   free (worklist);
 }
 
@@ -565,6 +568,8 @@ compute_available (avloc, kill, avout, avin)
            }
     }
 
+  clear_aux_for_edges ();
+  clear_aux_for_blocks ();
   free (worklist);
 }
 
@@ -695,6 +700,7 @@ compute_nearerout (edge_list, farthest, st_avloc, nearer, nearerout)
                     nearerout[n_basic_blocks],
                     nearer[(size_t) e->aux]);
 
+  clear_aux_for_edges ();
   free (tos);
 }
 
@@ -1273,6 +1279,7 @@ optimize_mode_switching (file)
              }
        }
 
+      clear_aux_for_edges ();
       free_edge_list (edge_list);
     }