summaryrefslogtreecommitdiff
path: root/gcc/bitmap.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-06 20:39:46 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-06 20:39:46 +0000
commite97da9acca05b56be99bfd9abd8b83e5db5268fb (patch)
treefcab715a6c79d738a81d753254714e02889ad105 /gcc/bitmap.c
parent76d6e5e429f5ca1ba89341e4fd3cbd5f4a6f055f (diff)
downloadgcc-e97da9acca05b56be99bfd9abd8b83e5db5268fb.tar.gz
2008-06-06 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r136492 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@136504 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/bitmap.c')
-rw-r--r--gcc/bitmap.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index c2a66f96a73..97e60de6b3c 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -119,6 +119,7 @@ register_overhead (bitmap b, int amount)
/* Global data */
bitmap_element bitmap_zero_bits; /* An element of all zero bits. */
bitmap_obstack bitmap_default_obstack; /* The default bitmap obstack. */
+static int bitmap_default_obstack_depth;
static GTY((deletable)) bitmap_element *bitmap_ggc_free; /* Freelist of
GC'd elements. */
@@ -302,7 +303,11 @@ void
bitmap_obstack_initialize (bitmap_obstack *bit_obstack)
{
if (!bit_obstack)
- bit_obstack = &bitmap_default_obstack;
+ {
+ if (bitmap_default_obstack_depth++)
+ return;
+ bit_obstack = &bitmap_default_obstack;
+ }
#if !defined(__GNUC__) || (__GNUC__ < 2)
#define __alignof__(type) 0
@@ -323,7 +328,14 @@ void
bitmap_obstack_release (bitmap_obstack *bit_obstack)
{
if (!bit_obstack)
- bit_obstack = &bitmap_default_obstack;
+ {
+ if (--bitmap_default_obstack_depth)
+ {
+ gcc_assert (bitmap_default_obstack_depth > 0);
+ return;
+ }
+ bit_obstack = &bitmap_default_obstack;
+ }
bit_obstack->elements = NULL;
bit_obstack->heads = NULL;