collect2.c (main): Typo fixed.
[gcc.git] / gcc / ggc-common.c
index 2dca6aa9413812a0070431b718a63003c266b64c..2fa3d101493a13d5fd2ec15c617218685e365f3b 100644 (file)
@@ -220,7 +220,7 @@ ggc_mark_rtx_children (r)
          ggc_stats->size_rtxs[(int) code] += ggc_get_size (r);
        }
 
-      /* ??? If (some of) these are really pass-dependant info, do we
+      /* ??? If (some of) these are really pass-dependent info, do we
         have any right poking our noses in?  */
       switch (code)
        {
@@ -247,6 +247,7 @@ ggc_mark_rtx_children (r)
            case NOTE_INSN_RANGE_BEG:
            case NOTE_INSN_RANGE_END:
            case NOTE_INSN_LIVE:
+           case NOTE_INSN_EXPECTED_VALUE:
              ggc_mark_rtx (NOTE_RANGE_INFO (r));
              break;
 
@@ -257,7 +258,10 @@ ggc_mark_rtx_children (r)
 
            default:
              if (NOTE_LINE_NUMBER (r) >= 0)
-               ggc_mark_string (NOTE_SOURCE_FILE (r));
+               {
+           case NOTE_INSN_DELETED_LABEL:
+                 ggc_mark_string (NOTE_SOURCE_FILE (r));
+               }
              break;
            }
          break;
@@ -344,28 +348,12 @@ ggc_mark_trees ()
        case TREE_VEC:
          {
            int i = TREE_VEC_LENGTH (t);
+
            while (--i >= 0)
              ggc_mark_tree (TREE_VEC_ELT (t, i));
            continue;
          }
 
-       case SAVE_EXPR:
-         ggc_mark_tree (TREE_OPERAND (t, 0));
-         ggc_mark_tree (SAVE_EXPR_CONTEXT (t));
-         ggc_mark_rtx (SAVE_EXPR_RTL (t));
-         continue;
-
-       case RTL_EXPR:
-         ggc_mark_rtx (RTL_EXPR_SEQUENCE (t));
-         ggc_mark_rtx (RTL_EXPR_RTL (t));
-         continue;
-
-       case CALL_EXPR:
-         ggc_mark_tree (TREE_OPERAND (t, 0));
-         ggc_mark_tree (TREE_OPERAND (t, 1));
-         ggc_mark_rtx (CALL_EXPR_RTL (t));
-         continue;
-
        case COMPLEX_CST:
          ggc_mark_tree (TREE_REALPART (t));
          ggc_mark_tree (TREE_IMAGPART (t));
@@ -446,10 +434,17 @@ ggc_mark_trees ()
        case 'r': case '<': case '1':
        case '2': case 'e': case 's': /* Expressions.  */
          {
-           int i = tree_code_length[TREE_CODE (t)];
+           int i = TREE_CODE_LENGTH (TREE_CODE (t));
+           int first_rtl = first_rtl_op (TREE_CODE (t));
+
            while (--i >= 0)
-             ggc_mark_tree (TREE_OPERAND (t, i));
-           break;
+             {
+               if (i >= first_rtl)
+                 ggc_mark_rtx ((rtx) TREE_OPERAND (t, i));
+               else
+                 ggc_mark_tree (TREE_OPERAND (t, i));
+             }
+           break;      
          }
 
        case 'x':
@@ -585,7 +580,7 @@ ggc_alloc_string (contents, length)
       length = strlen (contents);
     }
 
-  string = (char *) ggc_alloc_obj (length + 1, 0);
+  string = (char *) ggc_alloc (length + 1);
   if (contents != NULL)
     memcpy (string, contents, length);
   string[length] = 0;
@@ -593,6 +588,16 @@ ggc_alloc_string (contents, length)
   return string;
 }
 
+/* Allocate a block of memory, then clear it.  */
+void *
+ggc_alloc_cleared (size)
+     size_t size;
+{
+  void *buf = ggc_alloc (size);
+  memset (buf, 0, size);
+  return buf;
+}
+
 /* Print statistics that are independent of the collector in use.  */
 
 void