diff options
author | Steven Bosscher <steven@gcc.gnu.org> | 2012-08-10 09:27:31 +0000 |
---|---|---|
committer | Steven Bosscher <steven@gcc.gnu.org> | 2012-08-10 09:27:31 +0000 |
commit | 57f7b89eebd297f2f4a76ed81b731b150bd4e1da (patch) | |
tree | 36d238929fded9774c6d13509cfb2761c743b8bc /gcc/tree-ssa-pre.c | |
parent | e5f432d060a6ef33ccedf1c727f530b1243513e9 (diff) |
* tree-ssa-pre.c (alloc_expression_id): Fix use of VEC_reserve.
* tree-into-ssa.c (get_ssa_name_ann): Likewise.
(mark_phi_for_rewrite): Likewise.
(compute_global_livein): Use VEC_reserve outside the innermost
loop and VEC_quick_push instead of VEC_safe_push in that loop.
(update_ssa): Re-organize to avoid unnecessary sbitmap_zero'ing
of new_ssa_names and old_ssa_names. Allocate phis_to_rewrite to
the correct initial size.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@190289 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-pre.c')
-rw-r--r-- | gcc/tree-ssa-pre.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 6264b54eebd..9b186ddc577 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -249,7 +249,8 @@ alloc_expression_id (pre_expr expr) /* VEC_safe_grow_cleared allocates no headroom. Avoid frequent re-allocations by using VEC_reserve upfront. There is no VEC_quick_grow_cleared unfortunately. */ - VEC_reserve (unsigned, heap, name_to_id, num_ssa_names); + unsigned old_len = VEC_length (unsigned, name_to_id); + VEC_reserve (unsigned, heap, name_to_id, num_ssa_names - old_len); VEC_safe_grow_cleared (unsigned, heap, name_to_id, num_ssa_names); gcc_assert (VEC_index (unsigned, name_to_id, version) == 0); VEC_replace (unsigned, name_to_id, version, expr->id); |