From bcdbb85f26aa0d25645d51ddf728a049b201c980 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Wed, 19 Jun 2024 11:42:16 +0200 Subject: Avoid global bitmap space in ranger. gcc/ChangeLog: * gimple-range-cache.cc (update_list::update_list): Add m_bitmaps. (update_list::~update_list): Initialize m_bitmaps. * gimple-range-cache.h (ssa_lazy_cache): Add m_bitmaps. * gimple-range.cc (enable_ranger): Remove global bitmap initialization. (disable_ranger): Remove global bitmap release. --- gcc/gimple-range-cache.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gcc/gimple-range-cache.h') diff --git a/gcc/gimple-range-cache.h b/gcc/gimple-range-cache.h index 63410d5..0ea34d3 100644 --- a/gcc/gimple-range-cache.h +++ b/gcc/gimple-range-cache.h @@ -78,8 +78,12 @@ protected: class ssa_lazy_cache : public ssa_cache { public: - inline ssa_lazy_cache () { active_p = BITMAP_ALLOC (NULL); } - inline ~ssa_lazy_cache () { BITMAP_FREE (active_p); } + inline ssa_lazy_cache () + { + bitmap_obstack_initialize (&m_bitmaps); + active_p = BITMAP_ALLOC (&m_bitmaps); + } + inline ~ssa_lazy_cache () { bitmap_obstack_release (&m_bitmaps); } inline bool empty_p () const { return bitmap_empty_p (active_p); } virtual bool has_range (tree name) const; virtual bool set_range (tree name, const vrange &r); @@ -89,6 +93,7 @@ public: virtual void clear (); void merge (const ssa_lazy_cache &); protected: + bitmap_obstack m_bitmaps; bitmap active_p; }; -- cgit v1.1