From 85b938d0b42513fa3a4dcd39541674d161b651f9 Mon Sep 17 00:00:00 2001 From: kazu Date: Wed, 11 Jan 2006 18:43:15 +0000 Subject: * basic-block.h (control_flow_graph): Change the type of x_basic_block_info to VEC(basic_block,gc) *. (BASIC_BLOCK_FOR_FUNCTION, BASIC_BLOCK): Adjust the uses of basic_block_info. (SET_BASIC_BLOCK): New. * cfg.c (compact_blocks, expunge_block): Use SET_BASIC_BLOCK instead of BASIC_BLOCK when assigning to BASIC_BLOCK. * cfgbuild.c (find_basic_blocks): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. * cfgrtl.c (create_basic_block_structure, rtl_create_basic_block): Likewise. * ifcvt.c (find_if_case_1): Likewise. * tree-cfg.c (init_empty_tree_cfg, build_tree_cfg, create_bb): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109596 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cfgrtl.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gcc/cfgrtl.c') 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++; -- cgit v1.2.1