OSDN Git Service

* stmt.c (mark_case_node): New function.
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Apr 2000 19:23:53 +0000 (19:23 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Apr 2000 19:23:53 +0000 (19:23 +0000)
(mark_case_nesting): Call it.

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

gcc/ChangeLog
gcc/stmt.c

index d9eb7c4..b1f0c33 100644 (file)
@@ -1,5 +1,8 @@
 Tue Apr 18 14:16:47 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
+       * stmt.c (mark_case_node): New function.
+       (mark_case_nesting): Call it.
+
        * expmed.c (emit_store_flag): If comparing two-word integer
        with zero, can optimize NE, EQ, GE, and LT.
 
index 8516e36..5bad339 100644 (file)
@@ -430,6 +430,7 @@ static void mark_cond_nesting           PARAMS ((struct nesting *));
 static void mark_loop_nesting           PARAMS ((struct nesting *));
 static void mark_block_nesting          PARAMS ((struct nesting *));
 static void mark_case_nesting           PARAMS ((struct nesting *));
+static void mark_case_node             PARAMS ((struct case_node *));
 static void mark_goto_fixup             PARAMS ((struct goto_fixup *));
 
 \f
@@ -509,28 +510,35 @@ mark_case_nesting (n)
 {
   while (n)
     {
-      struct case_node *node;
-
       ggc_mark_rtx (n->exit_label);
       ggc_mark_rtx (n->data.case_stmt.start);
 
-      node = n->data.case_stmt.case_list;
-      while (node)
-       {
-         ggc_mark_tree (node->low);
-         ggc_mark_tree (node->high);
-         ggc_mark_tree (node->code_label);
-         node = node->right;
-       }
-
       ggc_mark_tree (n->data.case_stmt.default_label);
       ggc_mark_tree (n->data.case_stmt.index_expr);
       ggc_mark_tree (n->data.case_stmt.nominal_type);
 
+      mark_case_node (n->data.case_stmt.case_list);
       n = n->next;
     }
 }
 
+/* Mark C for GC.  */
+
+static void
+mark_case_node (c)
+     struct case_node *c;
+{
+  if (c != 0)
+    {
+      ggc_mark_tree (c->low);
+      ggc_mark_tree (c->high);
+      ggc_mark_tree (c->code_label);
+
+      mark_case_node (c->right);
+      mark_case_node (c->left);
+    }
+}
+
 /* Mark G for GC.  */
 
 static void