aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2015-11-11 15:04:47 +0100
committerMartin Liska <marxin@gcc.gnu.org>2015-11-11 14:04:47 +0000
commit7ad291c0e8e6a489d98741eb958736cc5f09d0b7 (patch)
tree7e8d4364662311c5caa981cc01d78f86e575561f
parentdcfe3c8f32c207cb4d8cb77425604ae72bee406a (diff)
downloadgcc-7ad291c0e8e6a489d98741eb958736cc5f09d0b7.zip
gcc-7ad291c0e8e6a489d98741eb958736cc5f09d0b7.tar.gz
gcc-7ad291c0e8e6a489d98741eb958736cc5f09d0b7.tar.bz2
re PR rtl-optimization/68287 (conditional jump or move depends on uninitialized value in lra-lives.c:1048)
Fix PR rtl-optimization/68287 PR rtl-optimization/68287 * lra-lives.c (lra_create_live_ranges_1): Reserve the right number of elements. Co-Authored-By: Richard Biener <rguenther@suse.de> From-SVN: r230163
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/lra-lives.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e955e41..fb7e4f0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2015-11-11 Martin Liska <mliska@suse.cz>
+ Richard Biener <rguenther@suse.de>
+
+ PR rtl-optimization/68287
+ * lra-lives.c (lra_create_live_ranges_1): Reserve the right
+ number of elements.
+
2015-11-11 Simon Dardis <simon.dardis@imgtec.com>
* config/mips/mips.c (mips_breakable_sequence_p): New function.
diff --git a/gcc/lra-lives.c b/gcc/lra-lives.c
index 9453759..5f76a87 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);