Skip to content

Commit

Permalink
middle-end/114604 - ranger allocates bitmap without initialized obstack
Browse files Browse the repository at this point in the history
The following fixes ranger bitmap allocation when invoked from IPA
context where the global bitmap obstack possibly isn't initialized.
Instead of trying to use one of the ranger obstacks the following
simply initializes the global bitmap obstack around an active ranger.

	PR middle-end/114604
	* gimple-range.cc (enable_ranger): Initialize the global
	bitmap obstack.
	(disable_ranger): Release it.
  • Loading branch information
rguenth committed Apr 9, 2024
1 parent ddee437 commit d76df69
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gcc/gimple-range.cc
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,8 @@ enable_ranger (struct function *fun, bool use_imm_uses)
{
gimple_ranger *r;

bitmap_obstack_initialize (NULL);

gcc_checking_assert (!fun->x_range_query);
r = new gimple_ranger (use_imm_uses);
fun->x_range_query = r;
Expand All @@ -705,6 +707,8 @@ disable_ranger (struct function *fun)
gcc_checking_assert (fun->x_range_query);
delete fun->x_range_query;
fun->x_range_query = NULL;

bitmap_obstack_release (NULL);
}

// ------------------------------------------------------------------------
Expand Down

0 comments on commit d76df69

Please sign in to comment.