OSDN Git Service

Fix another mips typo.
[pf3gnuchains/gcc-fork.git] / gcc / et-forest.c
index 77194c6..9b09971 100644 (file)
@@ -56,7 +56,7 @@ struct et_occ
 };
 
 static alloc_pool et_nodes;
-static alloc_pool et_occurences;
+static alloc_pool et_occurrences;
 
 /* Changes depth of OCC to D.  */
 
@@ -206,9 +206,13 @@ et_check_tree_sanity (struct et_occ *occ)
 
 /* For recording the paths.  */
 
+/* An ad-hoc constant; if the function has more blocks, this won't work,
+   but since it is used for debugging only, it does not matter.  */
+#define MAX_NODES 100000
+
 static int len;
-static void *datas[100000];
-static int depths[100000];
+static void *datas[MAX_NODES];
+static int depths[MAX_NODES];
 
 /* Records the path represented by OCC, with depth incremented by DEPTH.  */
 
@@ -228,6 +232,10 @@ record_path_before_1 (struct et_occ *occ, int depth)
     }
 
   fprintf (stderr, "%d (%d); ", ((basic_block) occ->of->data)->index, depth);
+
+  if (len >= MAX_NODES)
+    abort ();
+
   depths[len] = depth;
   datas[len] = occ->of;
   len++;
@@ -459,9 +467,9 @@ et_new_occ (struct et_node *node)
 {
   struct et_occ *nw;
   
-  if (!et_occurences)
-    et_occurences = create_alloc_pool ("et_occ pool", sizeof (struct et_occ), 300);
-  nw = pool_alloc (et_occurences);
+  if (!et_occurrences)
+    et_occurrences = create_alloc_pool ("et_occ pool", sizeof (struct et_occ), 300);
+  nw = pool_alloc (et_occurrences);
 
   nw->of = node;
   nw->parent = NULL;
@@ -509,7 +517,7 @@ et_free_tree (struct et_node *t)
   if (t->father)
     et_split (t);
 
-  pool_free (et_occurences, t->rightmost_occ);
+  pool_free (et_occurrences, t->rightmost_occ);
   pool_free (et_nodes, t);
 }
 
@@ -602,7 +610,7 @@ et_split (struct et_node *t)
   rmost->depth = 0;
   rmost->min = 0;
 
-  pool_free (et_occurences, p_occ);
+  pool_free (et_occurrences, p_occ);
 
   /* Update the tree.  */
   if (father->son == t)