re PR rtl-optimization/68287 (conditional jump or move depends on uninitialized value...
authorMartin Liska <mliska@suse.cz>
Wed, 11 Nov 2015 14:04:47 +0000 (15:04 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 11 Nov 2015 14:04:47 +0000 (14:04 +0000)
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

gcc/ChangeLog
gcc/lra-lives.c

index e955e4175b94f617b494652b90cd550379fb87e9..fb7e4f071f012dca32dc128ebe8609db27fcedf3 100644 (file)
@@ -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.
index 9453759a521c45fea00a2e9f87bb6ca87fa6690f..5f76a87de977c5930e38e0233d49acde29d15941 100644 (file)
@@ -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);