OSDN Git Service

Fix for PR libgcj/6081:
[pf3gnuchains/gcc-fork.git] / gcc / ggc-common.c
index 154d47b..6a6b69b 100644 (file)
@@ -1,5 +1,5 @@
 /* Simple garbage collection for the GNU compiler.
-   Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -30,16 +30,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "hashtab.h"
 #include "varray.h"
 #include "ggc.h"
+#include "langhooks.h"
 
 /* Statistics about the allocation.  */
 static ggc_statistics *ggc_stats;
 
-/* The FALSE_LABEL_STACK, declared in except.h, has language-dependent
-   semantics.  If a front-end needs to mark the false label stack, it
-   should set this pointer to a non-NULL value.  Otherwise, no marking
-   will be done.  */
-void (*lang_mark_false_label_stack) PARAMS ((struct label_node *));
-
 /* Trees that have been marked, but whose children still need marking.  */
 varray_type ggc_pending_trees;
 
@@ -165,7 +160,7 @@ ggc_del_root (base)
       x = x->next;
     }
 
-  abort();
+  abort ();
 }
 
 /* Add a hash table to be scanned when all roots have been processed.  We
@@ -298,6 +293,9 @@ ggc_mark_rtx_children (r)
         have any right poking our noses in?  */
       switch (code)
        {
+       case MEM:
+         ggc_mark (MEM_ATTRS (r));
+         break;
        case JUMP_INSN:
          ggc_mark_rtx (JUMP_LABEL (r));
          break;
@@ -433,7 +431,7 @@ ggc_mark_trees ()
          break;
 
        case IDENTIFIER_NODE:
-         lang_mark_tree (t);
+         (*lang_hooks.mark_tree) (t);
          continue;
 
        default:
@@ -453,16 +451,21 @@ ggc_mark_trees ()
          ggc_mark_tree (DECL_INITIAL (t));
          ggc_mark_tree (DECL_ABSTRACT_ORIGIN (t));
          ggc_mark_tree (DECL_SECTION_NAME (t));
-         ggc_mark_tree (DECL_MACHINE_ATTRIBUTES (t));
+         ggc_mark_tree (DECL_ATTRIBUTES (t));
          if (DECL_RTL_SET_P (t))
            ggc_mark_rtx (DECL_RTL (t));
          ggc_mark_rtx (DECL_LIVE_RANGE_RTL (t));
          ggc_mark_tree (DECL_VINDEX (t));
          if (DECL_ASSEMBLER_NAME_SET_P (t))
            ggc_mark_tree (DECL_ASSEMBLER_NAME (t));
-         if (TREE_CODE (t) == FUNCTION_DECL && DECL_SAVED_INSNS (t))
-           ggc_mark_struct_function (DECL_SAVED_INSNS (t));
-         lang_mark_tree (t);
+         if (TREE_CODE (t) == FUNCTION_DECL)
+           {
+             ggc_mark_tree (DECL_SAVED_TREE (t));
+             ggc_mark_tree (DECL_INLINED_FNS (t));
+             if (DECL_SAVED_INSNS (t))
+               ggc_mark_struct_function (DECL_SAVED_INSNS (t));
+           }
+         (*lang_hooks.mark_tree) (t);
          break;
 
        case 't': /* A type node.  */
@@ -479,7 +482,7 @@ ggc_mark_trees ()
          ggc_mark_tree (TYPE_MAIN_VARIANT (t));
          ggc_mark_tree (TYPE_BINFO (t));
          ggc_mark_tree (TYPE_CONTEXT (t));
-         lang_mark_tree (t);
+         (*lang_hooks.mark_tree) (t);
          break;
 
        case 'b': /* A lexical block.  */
@@ -510,7 +513,7 @@ ggc_mark_trees ()
          }
 
        case 'x':
-         lang_mark_tree (t);
+         (*lang_hooks.mark_tree) (t);
          break;
        }
     }