Skip to content

Commit d76df69

Browse files
committed
middle-end/114604 - ranger allocates bitmap without initialized obstack
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.
1 parent ddee437 commit d76df69

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gcc/gimple-range.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,8 @@ enable_ranger (struct function *fun, bool use_imm_uses)
689689
{
690690
gimple_ranger *r;
691691

692+
bitmap_obstack_initialize (NULL);
693+
692694
gcc_checking_assert (!fun->x_range_query);
693695
r = new gimple_ranger (use_imm_uses);
694696
fun->x_range_query = r;
@@ -705,6 +707,8 @@ disable_ranger (struct function *fun)
705707
gcc_checking_assert (fun->x_range_query);
706708
delete fun->x_range_query;
707709
fun->x_range_query = NULL;
710+
711+
bitmap_obstack_release (NULL);
708712
}
709713

710714
// ------------------------------------------------------------------------

0 commit comments

Comments
 (0)