From 13b8babff2d06ff16e262df8a96efd78ac6154f8 Mon Sep 17 00:00:00 2001 From: marxin Date: Wed, 11 Nov 2015 14:04:47 +0000 Subject: [PATCH] Fix PR rtl-optimization/68287 PR rtl-optimization/68287 * lra-lives.c (lra_create_live_ranges_1): Reserve the right number of elements. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230163 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/lra-lives.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e955e4175b94..fb7e4f071f01 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-11-11 Martin Liska + Richard Biener + + PR rtl-optimization/68287 + * lra-lives.c (lra_create_live_ranges_1): Reserve the right + number of elements. + 2015-11-11 Simon Dardis * config/mips/mips.c (mips_breakable_sequence_p): New function. diff --git a/gcc/lra-lives.c b/gcc/lra-lives.c index 9453759a521c..5f76a87de977 100644 --- a/gcc/lra-lives.c +++ b/gcc/lra-lives.c @@ -1241,8 +1241,8 @@ lra_create_live_ranges_1 (bool all_p, bool dead_insn_p) unused_set = sparseset_alloc (max_regno); curr_point = 0; unsigned new_length = get_max_uid () * 2; - if (point_freq_vec.length () < new_length) - point_freq_vec.safe_grow (new_length); + point_freq_vec.truncate (0); + point_freq_vec.reserve_exact (new_length); lra_point_freq = point_freq_vec.address (); int *post_order_rev_cfg = XNEWVEC (int, last_basic_block_for_fn (cfun)); int n_blocks_inverted = inverted_post_order_compute (post_order_rev_cfg); -- 2.47.2