summaryrefslogtreecommitdiff
path: root/gcc/cfgrtl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r--gcc/cfgrtl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 6ff6c391193..765247260f2 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -305,7 +305,7 @@ create_basic_block_structure (rtx head, rtx end, rtx bb_note, basic_block after)
bb->index = last_basic_block++;
bb->flags = BB_NEW | BB_RTL;
link_block (bb, after);
- BASIC_BLOCK (bb->index) = bb;
+ SET_BASIC_BLOCK (bb->index, bb);
update_bb_for_insn (bb);
BB_SET_PARTITION (bb, BB_UNPARTITIONED);
@@ -328,10 +328,14 @@ rtl_create_basic_block (void *headp, void *endp, basic_block after)
basic_block bb;
/* Grow the basic block array if needed. */
- if ((size_t) last_basic_block >= VARRAY_SIZE (basic_block_info))
+ if ((size_t) last_basic_block >= VEC_length (basic_block, basic_block_info))
{
+ size_t old_size = VEC_length (basic_block, basic_block_info);
size_t new_size = last_basic_block + (last_basic_block + 3) / 4;
- VARRAY_GROW (basic_block_info, new_size);
+ basic_block *p;
+ VEC_safe_grow (basic_block, gc, basic_block_info, new_size);
+ p = VEC_address (basic_block, basic_block_info);
+ memset (&p[old_size], 0, sizeof (basic_block) * (new_size - old_size));
}
n_basic_blocks++;