This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PCH] allow bitmaps to be GCable



This also fixes a memory leak in except.c.

Bootstrapped & tested on i686-pc-linux-gnu.

-- 
Geoff Keating <geoffk@redhat.com>

===File ~/patches/pchbranch-bitmapgc.patch==================
2002-05-17  Geoffrey Keating  <geoffk@redhat.com>

	* bitmap.c: Include ggc.h, gt-bitmap.h.
	(bitmap_ggc_free): New.
	(bitmap_elem_to_freelist): New.
	(bitmap_element_free): Use bitmap_elem_to_freelist.
	(bitmap_element_allocate): Allow use of GGC.
	(bitmap_clear): Use bitmap_elem_to_freelist.
	(bitmap_copy): Update for change to bitmap_element_allocate.
	(bitmap_set_bit): Likewise.
	(bitmap_operation): Update for changes elsewhere.
	(bitmap_initialize): Allow to create bitmaps that will use GGC.
	* bitmap.h (struct bitmap_element_def): Use gengtype.
	(struct bitmap_head_def): Likewise.  Also add 'using_obstack' field.
	(bitmap_initialize): Add extra parameter.
	(BITMAP_OBSTACK_ALLOC): Update for change to bitmap_initialize.
	(BITMAP_ALLOCA): Delete.
	(BITMAP_XMALLOC): Update for change to bitmap_initialize.
	(BITMAP_GGC_ALLOC): New.
	* Makefile.in (gtype-desc.o): Add bitmap.h.
	(bitmap.o): Add gt-bitmap.h, $(GGC_H).
	(GTFILES): Add bitmap.c.
	(gt-bitmap.h): New rule.
	($(HOST_PREFIX_1)bitmap.o): Add gt-bitmap.h.
	* basic-block.h: Update for changes to bitmap_initialize.
	* except.c (exception_handler_label_map): Move into...
	(struct eh_status): Here.
	(struct eh_region): Make 'aka' GCable.
	(free_eh_status): Don't need to specially handle
	exception_handler_label_map.
	(add_ehl_entry): Update for changes to exception_handler_label_map.
	(find_exception_handler_labels): Likewise.
	(remove_exception_handler_label): Likewise.
	(maybe_remove_eh_handler): Likewise.
	(for_each_eh_label): Likewise.
	(remove_eh_handler): Allocate 'aka' using GGC.
	* gengtype.c (get_output_file_with_visibility): Add bitmap.h
	to list of includes.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.822.2.16
diff -p -u -p -r1.822.2.16 Makefile.in
--- Makefile.in	16 May 2002 00:17:55 -0000	1.822.2.16
+++ Makefile.in	18 May 2002 03:24:45 -0000
@@ -1330,7 +1330,7 @@ version.o: version.c version.h
 
 gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) varray.h $(HASHTAB_H) \
 	$(TREE_H) $(RTL_H) function.h insn-config.h expr.h $(OPTABS_H) \
-	libfuncs.h debug.h $(GGC_H)
+	libfuncs.h debug.h $(GGC_H) bitmap.h
 
 ggc-common.o: ggc-common.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) \
 	flags.h $(GGC_H) varray.h $(HASHTAB_H) $(TM_P_H) langhooks.h
@@ -1568,8 +1568,8 @@ regclass.o : regclass.c $(CONFIG_H) $(SY
 local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h \
    $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
    output.h function.h $(INSN_ATTR_H) toplev.h  except.h $(TM_P_H)
-bitmap.o : bitmap.c $(GCONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h $(BASIC_BLOCK_H) \
-   $(REGS_H)
+bitmap.o : bitmap.c $(GCONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h \
+   $(BASIC_BLOCK_H) $(REGS_H) $(GGC_H)
 	$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
 global.o : global.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h reload.h function.h \
    $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h toplev.h \
@@ -1825,8 +1825,8 @@ GTFILES = $(GCONFIG_H) \
   $(srcdir)/bitmap.h $(srcdir)/function.h  $(srcdir)/rtl.h $(srcdir)/optabs.h \
   $(srcdir)/tree.h $(srcdir)/libfuncs.h $(srcdir)/hashtable.h \
   $(srcdir)/c-common.h $(srcdir)/c-tree.h \
-  $(srcdir)/alias.c $(srcdir)/cselib.c $(srcdir)/emit-rtl.c \
-  $(srcdir)/except.c $(srcdir)/explow.c $(srcdir)/expr.c \
+  $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c \
+  $(srcdir)/emit-rtl.c $(srcdir)/except.c $(srcdir)/explow.c $(srcdir)/expr.c \
   $(srcdir)/fold-const.c $(srcdir)/function.c \
   $(srcdir)/gcse.c $(srcdir)/integrate.c $(srcdir)/lists.c $(srcdir)/optabs.c \
   $(srcdir)/profile.c $(srcdir)/regclass.c $(srcdir)/sdbout.c \
@@ -1841,7 +1841,7 @@ gtype-desc.h gtype-desc.c gt-except.h gt
 gt-integrate.h gt-stmt.h gt-tree.h gt-varasm.h gt-emit-rtl.h : s-gtype; @true
 gt-explow.h gt-stor-layout.h gt-regclass.h gt-lists.h : s-gtype; @true
 gt-alias.h gt-cselib.h gt-fold-const.h gt-gcse.h gt-profile.h : s-gtype; @true
-gt-expr.h gt-sdbout.h gt-optabs.h : s-gtype ; @true
+gt-expr.h gt-sdbout.h gt-optabs.h gt-bitmap.h : s-gtype ; @true
 gt-c-common.h gt-c-decl.h gt-c-parse.h gt-c-pragma.h : s-gtype; @true
 gtype-c.h : s-gtype ; @true
 
@@ -2021,8 +2021,8 @@ $(HOST_PREFIX_1)print-rtl.o: $(srcdir)/p
 	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > $(HOST_PREFIX)print-rtl.c
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c $(OUTPUT_OPTION)
 
-$(HOST_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(HCONFIG_H) $(SYSTEM_H) $(RTL_H) \
-  flags.h $(BASIC_BLOCK_H) $(REGS_H)
+$(HOST_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(HCONFIG_H) $(SYSTEM_H) \
+  $(RTL_H) flags.h $(BASIC_BLOCK_H) $(REGS_H) $(GGC_H)
 	rm -f $(HOST_PREFIX)bitmap.c
 	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/bitmap.c > $(HOST_PREFIX)bitmap.c
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)bitmap.c $(OUTPUT_OPTION)
Index: basic-block.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/basic-block.h,v
retrieving revision 1.133.2.3
diff -p -u -p -r1.133.2.3 basic-block.h
--- basic-block.h	6 May 2002 18:43:02 -0000	1.133.2.3
+++ basic-block.h	18 May 2002 03:24:45 -0000
@@ -33,7 +33,7 @@ typedef bitmap_head regset_head;
 typedef bitmap regset;
 
 /* Initialize a new regset.  */
-#define INIT_REG_SET(HEAD) bitmap_initialize (HEAD)
+#define INIT_REG_SET(HEAD) bitmap_initialize (HEAD, 1)
 
 /* Clear a register set by freeing up the linked list.  */
 #define CLEAR_REG_SET(HEAD) bitmap_clear (HEAD)
@@ -99,7 +99,7 @@ do {									\
 #define OBSTACK_ALLOC_REG_SET(OBSTACK) BITMAP_OBSTACK_ALLOC (OBSTACK)
 
 /* Initialize a register set.  Returns the new register set.  */
-#define INITIALIZE_REG_SET(HEAD) bitmap_initialize (&HEAD)
+#define INITIALIZE_REG_SET(HEAD) bitmap_initialize (&HEAD, 1)
 
 /* Do any cleanup needed on a regset when it is no longer used.  */
 #define FREE_REG_SET(REGSET) BITMAP_FREE(REGSET)
Index: bitmap.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/bitmap.c,v
retrieving revision 1.33
diff -p -u -p -r1.33 bitmap.c
--- bitmap.c	31 Oct 2001 03:01:15 -0000	1.33
+++ bitmap.c	18 May 2002 03:24:45 -0000
@@ -23,6 +23,7 @@ Software Foundation, 59 Temple Place - S
 #include "rtl.h"
 #include "flags.h"
 #include "obstack.h"
+#include "ggc.h"
 #include "bitmap.h"
 
 /* Obstack to allocate bitmap elements from.  */
@@ -40,13 +41,33 @@ static int bitmap_obstack_init = FALSE;
 /* Global data */
 bitmap_element bitmap_zero_bits;	/* An element of all zero bits.  */
 static bitmap_element *bitmap_free;	/* Freelist of bitmap elements.  */
+static GTY((deletable (""))) bitmap_element *bitmap_ggc_free;
 
+static void bitmap_elem_to_freelist	PARAMS ((bitmap, bitmap_element *));
 static void bitmap_element_free		PARAMS ((bitmap, bitmap_element *));
-static bitmap_element *bitmap_element_allocate PARAMS ((void));
+static bitmap_element *bitmap_element_allocate PARAMS ((bitmap));
 static int bitmap_element_zerop		PARAMS ((bitmap_element *));
 static void bitmap_element_link		PARAMS ((bitmap, bitmap_element *));
 static bitmap_element *bitmap_find_bit	PARAMS ((bitmap, unsigned int));
 
+/* Add ELEM to the appropriate freelist.  */
+static INLINE void
+bitmap_elem_to_freelist (head, elt)
+     bitmap head;
+     bitmap_element *elt;
+{
+  if (head->using_obstack)
+    {
+      elt->next = bitmap_free;
+      bitmap_free = elt;
+    }
+  else
+    {
+      elt->next = bitmap_ggc_free;
+      bitmap_ggc_free = elt;
+    }
+}
+
 /* Free a bitmap element.  Since these are allocated off the
    bitmap_obstack, "free" actually means "put onto the freelist".  */
 
@@ -75,56 +96,68 @@ bitmap_element_free (head, elt)
       if (head->current)
 	head->indx = head->current->indx;
     }
-
-  elt->next = bitmap_free;
-  bitmap_free = elt;
+  bitmap_elem_to_freelist (head, elt);
 }
 
 /* Allocate a bitmap element.  The bits are cleared, but nothing else is.  */
 
 static INLINE bitmap_element *
-bitmap_element_allocate ()
+bitmap_element_allocate (head)
+     bitmap head;
 {
   bitmap_element *element;
 
-  if (bitmap_free != 0)
-    {
-      element = bitmap_free;
-      bitmap_free = element->next;
-    }
-  else
+  if (head->using_obstack)
     {
-      /* We can't use gcc_obstack_init to initialize the obstack since
-	 print-rtl.c now calls bitmap functions, and bitmap is linked
-	 into the gen* functions.  */
-      if (!bitmap_obstack_init)
+      if (bitmap_free != 0)
 	{
-	  bitmap_obstack_init = TRUE;
-
-	  /* Let particular systems override the size of a chunk.  */
+	  element = bitmap_free;
+	  bitmap_free = element->next;
+	}
+      else
+	{
+	  /* We can't use gcc_obstack_init to initialize the obstack since
+	     print-rtl.c now calls bitmap functions, and bitmap is linked
+	     into the gen* functions.  */
+	  if (!bitmap_obstack_init)
+	    {
+	      bitmap_obstack_init = TRUE;
+	      
+	      /* Let particular systems override the size of a chunk.  */
 #ifndef OBSTACK_CHUNK_SIZE
 #define OBSTACK_CHUNK_SIZE 0
 #endif
-	  /* Let them override the alloc and free routines too.  */
+	      /* Let them override the alloc and free routines too.  */
 #ifndef OBSTACK_CHUNK_ALLOC
 #define OBSTACK_CHUNK_ALLOC xmalloc
 #endif
 #ifndef OBSTACK_CHUNK_FREE
 #define OBSTACK_CHUNK_FREE free
 #endif
-
+	      
 #if !defined(__GNUC__) || (__GNUC__ < 2)
 #define __alignof__(type) 0
 #endif
-
-	  obstack_specify_allocation (&bitmap_obstack, OBSTACK_CHUNK_SIZE,
-				      __alignof__ (bitmap_element),
-				      (void *(*) PARAMS ((long))) OBSTACK_CHUNK_ALLOC,
-				      (void (*) PARAMS ((void *))) OBSTACK_CHUNK_FREE);
+	      
+	      obstack_specify_allocation (&bitmap_obstack, OBSTACK_CHUNK_SIZE,
+					  __alignof__ (bitmap_element),
+					  (void *(*) PARAMS ((long))) OBSTACK_CHUNK_ALLOC,
+					  (void (*) PARAMS ((void *))) OBSTACK_CHUNK_FREE);
+	    }
+	  
+	  element = (bitmap_element *) obstack_alloc (&bitmap_obstack,
+						      sizeof (bitmap_element));
 	}
-
-      element = (bitmap_element *) obstack_alloc (&bitmap_obstack,
-						  sizeof (bitmap_element));
+    }
+  else
+    {
+      if (bitmap_ggc_free != NULL)
+	{
+          element = bitmap_ggc_free;
+          bitmap_ggc_free = element->next;
+	}
+      else
+	element = ggc_alloc (sizeof (bitmap_element));
     }
 
   memset (element->bits, 0, sizeof (element->bits));
@@ -232,8 +265,7 @@ bitmap_clear (head)
   for (element = head->first; element != 0; element = next)
     {
       next = element->next;
-      element->next = bitmap_free;
-      bitmap_free = element;
+      bitmap_elem_to_freelist (head, element);
     }
 
   head->first = head->current =  0;
@@ -256,7 +288,7 @@ bitmap_copy (to, from)
   /* Copy elements in forward direction one at a time */
   for (from_ptr = from->first; from_ptr; from_ptr = from_ptr->next)
     {
-      bitmap_element *to_elt = bitmap_element_allocate ();
+      bitmap_element *to_elt = bitmap_element_allocate (to);
 
       to_elt->indx = from_ptr->indx;
 
@@ -362,7 +394,7 @@ bitmap_set_bit (head, bit)
 
   if (ptr == 0)
     {
-      ptr = bitmap_element_allocate ();
+      ptr = bitmap_element_allocate (head);
       ptr->indx = bit / BITMAP_ELEMENT_ALL_BITS;
       ptr->bits[word_num] = bit_val;
       bitmap_element_link (head, ptr);
@@ -593,8 +625,7 @@ bitmap_operation (to, from1, from2, oper
 	  changed = 1;
 	  to_tmp = to_ptr;
 	  to_ptr = to_ptr->next;
-	  to_tmp->next = bitmap_free;
-	  bitmap_free = to_tmp;
+	  bitmap_elem_to_freelist (to, to_tmp);
 	}
       if (to_ptr && to_ptr->indx == indx)
 	{
@@ -602,7 +633,7 @@ bitmap_operation (to, from1, from2, oper
 	  to_ptr = to_ptr->next;
 	}
       else
-	to_tmp = bitmap_element_allocate ();
+	to_tmp = bitmap_element_allocate (to);
 
       /* Do the operation, and if any bits are set, link it into the
 	 linked list.  */
@@ -637,8 +668,7 @@ bitmap_operation (to, from1, from2, oper
 	}
       else
 	{
-	  to_tmp->next = bitmap_free;
-	  bitmap_free = to_tmp;
+	  bitmap_elem_to_freelist (to, to_tmp);
 	}
     }
 
@@ -648,8 +678,16 @@ bitmap_operation (to, from1, from2, oper
       changed = 1;
       for (to_tmp = to_ptr; to_tmp->next ; to_tmp = to_tmp->next)
 	continue;
-      to_tmp->next = bitmap_free;
-      bitmap_free = to_ptr;
+      if (to->using_obstack)
+	{
+	  to_tmp->next = bitmap_free;
+	  bitmap_free = to_ptr;
+	}
+      else
+	{
+	  to_tmp->next = bitmap_ggc_free;
+	  bitmap_ggc_free = to_ptr;
+	}
     }
 
 #undef DOIT
@@ -714,10 +752,15 @@ bitmap_union_of_diff (dst, a, b, c)
 /* Initialize a bitmap header.  */
 
 bitmap
-bitmap_initialize (head)
+bitmap_initialize (head, using_obstack)
      bitmap head;
+     int using_obstack;
 {
+  if (head == NULL && ! using_obstack)
+    head = ggc_alloc (sizeof (*head));
+  
   head->first = head->current = 0;
+  head->using_obstack = using_obstack;
 
   return head;
 }
@@ -799,3 +842,5 @@ bitmap_print (file, head, prefix, suffix
 			    });
   fputs (suffix, file);
 }
+
+#include "gt-bitmap.h"
Index: bitmap.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/bitmap.h,v
retrieving revision 1.25.6.2
diff -p -u -p -r1.25.6.2 bitmap.h
--- bitmap.h	6 May 2002 18:43:03 -0000	1.25.6.2
+++ bitmap.h	18 May 2002 03:24:45 -0000
@@ -40,7 +40,7 @@ Software Foundation, 59 Temple Place - S
    having to realloc and copy a giant bit array.  The `prev' field is
    undefined for an element on the free list.  */
 
-typedef struct bitmap_element_def
+typedef struct bitmap_element_def GTY(())
 {
   struct bitmap_element_def *next;		/* Next element.  */
   struct bitmap_element_def *prev;		/* Previous element.  */
@@ -49,11 +49,12 @@ typedef struct bitmap_element_def
 } bitmap_element;
 
 /* Head of bitmap linked list.  */
-typedef struct bitmap_head_def {
+typedef struct bitmap_head_def GTY(()) {
   bitmap_element *first;	/* First element in linked list.  */
   bitmap_element *current;	/* Last element looked at.  */
   unsigned int indx;		/* Index of last element looked at.  */
-
+  int using_obstack;		/* Are we using an obstack or ggc for
+                                   allocation?  */
 } bitmap_head;
 typedef struct bitmap_head_def *bitmap;
 
@@ -101,10 +102,12 @@ extern void debug_bitmap_file PARAMS ((F
 /* Print a bitmap */
 extern void bitmap_print PARAMS ((FILE *, bitmap, const char *, const char *));
 
-/* Initialize a bitmap header.  */
-extern bitmap bitmap_initialize PARAMS ((bitmap));
+/* Initialize a bitmap header.  If HEAD is NULL, a new header will be
+   allocated.  USING_OBSTACK indicates how elements should be allocated.  */
+extern bitmap bitmap_initialize PARAMS ((bitmap head, 
+					 int using_obstack));
 
-/* Release all memory held by bitmaps.  */
+/* Release all memory used by the bitmap obstack.  */
 extern void bitmap_release_memory PARAMS ((void));
 
 /* A few compatibility/functions macros for compatibility with sbitmaps */
@@ -118,22 +121,14 @@ extern int bitmap_last_set_bit PARAMS((b
 
 /* Allocate a bitmap with oballoc.  */
 #define BITMAP_OBSTACK_ALLOC(OBSTACK)				\
-  bitmap_initialize ((bitmap) obstack_alloc (OBSTACK, sizeof (bitmap_head)))
+  bitmap_initialize ((bitmap) obstack_alloc (OBSTACK, sizeof (bitmap_head)), 1)
+
+/* Allocate a bitmap with ggc_alloc.  */
+#define BITMAP_GGC_ALLOC()			\
+  bitmap_initialize (NULL, 0)
 
-/* Allocate a bitmap with alloca.  Note alloca cannot be passed as an
-   argument to a function, so we set a temporary variable to the value
-   returned by alloca and pass that variable to bitmap_initialize().
-   PTR is then set to the value returned from bitmap_initialize() to
-   avoid having it appear more than once in case it has side effects.  */
-#define BITMAP_ALLOCA(PTR) \
-do { \
-  bitmap temp_bitmap_ = (bitmap) alloca (sizeof (bitmap_head)); \
-  (PTR) = bitmap_initialize (temp_bitmap_); \
-} while (0)
-  
-/* Allocate a bitmap with xmalloc.  */
 #define BITMAP_XMALLOC()                                        \
-  bitmap_initialize ((bitmap) xmalloc (sizeof (bitmap_head)))
+  bitmap_initialize ((bitmap) xmalloc (sizeof (bitmap_head)), 1)
 
 /* Do any cleanup needed on a bitmap when it is no longer used.  */
 #define BITMAP_FREE(BITMAP)			\
Index: except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 1.210.2.8
diff -p -u -p -r1.210.2.8 except.c
--- except.c	10 May 2002 17:14:09 -0000	1.210.2.8
+++ except.c	18 May 2002 03:24:45 -0000
@@ -106,9 +106,6 @@ struct ehl_map_entry GTY(())
   struct eh_region *region;
 };
 
-static GTY ((param_is (struct ehl_map_entry))) 
-  htab_t exception_handler_label_map;
-
 static int call_site_base;
 static unsigned int sjlj_funcdef_number;
 static GTY ((param_is (union tree_node)))
@@ -137,7 +134,7 @@ struct eh_region GTY(())
 
   /* When a region is deleted, its parents inherit the REG_EH_REGION
      numbers already assigned.  */
-  bitmap GTY ((skip (""))) aka;
+  bitmap aka;
 
   /* Each region does exactly one thing.  */
   enum eh_region_type
@@ -243,6 +240,8 @@ struct eh_status GTY(())
   varray_type GTY ((varray_type (unsigned char))) ehspec_data;
   varray_type GTY ((varray_type (unsigned char))) action_record_data;
 
+  htab_t GTY ((param_is (struct ehl_map_entry))) exception_handler_label_map;
+
   struct call_site_record * GTY ((length ("%.call_site_data_used"))) 
     call_site_data;
   int call_site_data_used;
@@ -492,12 +491,6 @@ free_eh_status (f)
   VARRAY_FREE (eh->action_record_data);
 
   f->eh = NULL;
-
-  if (exception_handler_label_map)
-    {
-      htab_delete (exception_handler_label_map);
-      exception_handler_label_map = NULL;
-    }
 }
 
 
@@ -1196,7 +1189,7 @@ add_ehl_entry (label, region)
   entry->region = region;
 
   slot = (struct ehl_map_entry **)
-    htab_find_slot (exception_handler_label_map, entry, INSERT);
+    htab_find_slot (cfun->eh->exception_handler_label_map, entry, INSERT);
 
   /* Before landing pad creation, each exception handler has its own
      label.  After landing pad creation, the exception handlers may
@@ -1221,13 +1214,13 @@ find_exception_handler_labels ()
 {
   int i;
 
-  if (exception_handler_label_map)
-    htab_empty (exception_handler_label_map);
+  if (cfun->eh->exception_handler_label_map)
+    htab_empty (cfun->eh->exception_handler_label_map);
   else
     {
       /* ??? The expansion factor here (3/2) must be greater than the htab
 	 occupancy factor (4/3) to avoid unnecessary resizing.  */
-      exception_handler_label_map
+      cfun->eh->exception_handler_label_map
         = htab_create_ggc (cfun->eh->last_region_number * 3 / 2,
 			   ehl_hash, ehl_eq, NULL);
     }
@@ -2357,16 +2350,16 @@ remove_exception_handler_label (label)
 
   /* If exception_handler_label_map was not built yet,
      there is nothing to do.  */
-  if (exception_handler_label_map == NULL)
+  if (cfun->eh->exception_handler_label_map == NULL)
     return;
 
   tmp.label = label;
   slot = (struct ehl_map_entry **)
-    htab_find_slot (exception_handler_label_map, &tmp, NO_INSERT);
+    htab_find_slot (cfun->eh->exception_handler_label_map, &tmp, NO_INSERT);
   if (! slot)
     abort ();
 
-  htab_clear_slot (exception_handler_label_map, (void **) slot);
+  htab_clear_slot (cfun->eh->exception_handler_label_map, (void **) slot);
 }
 
 /* Splice REGION from the region tree etc.  */
@@ -2396,7 +2389,7 @@ remove_eh_handler (region)
   if (outer)
     {
       if (!outer->aka)
-        outer->aka = BITMAP_XMALLOC ();
+        outer->aka = BITMAP_GGC_ALLOC ();
       if (region->aka)
 	bitmap_a_or_b (outer->aka, outer->aka, region->aka);
       bitmap_set_bit (outer->aka, region->region_number);
@@ -2477,7 +2470,7 @@ maybe_remove_eh_handler (label)
 
   tmp.label = label;
   slot = (struct ehl_map_entry **)
-    htab_find_slot (exception_handler_label_map, &tmp, NO_INSERT);
+    htab_find_slot (cfun->eh->exception_handler_label_map, &tmp, NO_INSERT);
   if (! slot)
     return;
   region = (*slot)->region;
@@ -2490,7 +2483,7 @@ maybe_remove_eh_handler (label)
      are no more contained calls, which we don't see here.  */
   if (region->type == ERT_MUST_NOT_THROW)
     {
-      htab_clear_slot (exception_handler_label_map, (void **) slot);
+      htab_clear_slot (cfun->eh->exception_handler_label_map, (void **) slot);
       region->label = NULL_RTX;
     }
   else
@@ -2504,7 +2497,7 @@ void
 for_each_eh_label (callback)
      void (*callback) PARAMS ((rtx));
 {
-  htab_traverse (exception_handler_label_map, for_each_eh_label_1,
+  htab_traverse (cfun->eh->exception_handler_label_map, for_each_eh_label_1,
 		 (void *)callback);
 }
 
Index: gengtype.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/gengtype.c,v
retrieving revision 1.1.2.19
diff -p -u -p -r1.1.2.19 gengtype.c
--- gengtype.c	17 May 2002 17:57:29 -0000	1.1.2.19
+++ gengtype.c	18 May 2002 03:24:45 -0000
@@ -678,6 +678,7 @@ get_output_file_with_visibility (input_f
 	  fputs ("#include \"system.h\"\n", fm->output);
 	  fputs ("#include \"varray.h\"\n", fm->output);
 	  fputs ("#include \"hashtab.h\"\n", fm->output);
+	  fputs ("#include \"bitmap.h\"\n", fm->output);
 	  fputs ("#include \"tree.h\"\n", fm->output);
 	  fputs ("#include \"rtl.h\"\n", fm->output);
 	  fputs ("#include \"function.h\"\n", fm->output);
============================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]