diff options
Diffstat (limited to 'gcc/tree-ssa-address.c')
-rw-r--r-- | gcc/tree-ssa-address.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c index c5b8ff1056b..3b1e068515a 100644 --- a/gcc/tree-ssa-address.c +++ b/gcc/tree-ssa-address.c @@ -79,14 +79,12 @@ typedef struct GTY (()) mem_addr_template { be filled in. */ } mem_addr_template; -DEF_VEC_O (mem_addr_template); -DEF_VEC_ALLOC_O (mem_addr_template, gc); /* The templates. Each of the low five bits of the index corresponds to one component of TARGET_MEM_REF being present, while the high bits identify the address space. See TEMPL_IDX. */ -static GTY(()) VEC (mem_addr_template, gc) *mem_addr_template_list; +static GTY(()) vec<mem_addr_template, va_gc> *mem_addr_template_list; #define TEMPL_IDX(AS, SYMBOL, BASE, INDEX, STEP, OFFSET) \ (((int) (AS) << 5) \ @@ -209,14 +207,11 @@ addr_for_mem_ref (struct mem_address *addr, addr_space_t as, unsigned int templ_index = TEMPL_IDX (as, addr->symbol, addr->base, addr->index, st, off); - if (templ_index - >= VEC_length (mem_addr_template, mem_addr_template_list)) - VEC_safe_grow_cleared (mem_addr_template, gc, mem_addr_template_list, - templ_index + 1); + if (templ_index >= vec_safe_length (mem_addr_template_list)) + vec_safe_grow_cleared (mem_addr_template_list, templ_index + 1); /* Reuse the templates for addresses, so that we do not waste memory. */ - templ = &VEC_index (mem_addr_template, mem_addr_template_list, - templ_index); + templ = &(*mem_addr_template_list)[templ_index]; if (!templ->ref) { sym = (addr->symbol ? |