Fix off by one error in loop-unroll.c (PR rtl-optimization/82675).
authorMartin Liska <mliska@suse.cz>
Tue, 19 Dec 2017 13:20:07 +0000 (14:20 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Tue, 19 Dec 2017 13:20:07 +0000 (13:20 +0000)
2017-12-19  Martin Liska  <mliska@suse.cz>

PR rtl-optimization/82675
* loop-unroll.c (unroll_loop_constant_iterations): Allocate one
more element in sbitmap.

From-SVN: r255818

gcc/ChangeLog
gcc/loop-unroll.c

index 75c9a222f9f72e6901a16845db02ded74b1ebfb2..63b2ff5406fd68a3840a68fec4fd4c021e56ee7c 100644 (file)
@@ -1,3 +1,9 @@
+2017-12-19  Martin Liska  <mliska@suse.cz>
+
+       PR rtl-optimization/82675
+       * loop-unroll.c (unroll_loop_constant_iterations): Allocate one
+       more element in sbitmap.
+
 2017-12-19  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * gimplify.c (gimplify_expr): Use error_operand_p.
index cc154da9686a7f9b50a04deefcfdab7a263a03fe..b9d01ffe0664c63ad400b5a7ba20f613266b8be4 100644 (file)
@@ -498,7 +498,7 @@ unroll_loop_constant_iterations (struct loop *loop)
 
   exit_mod = niter % (max_unroll + 1);
 
-  auto_sbitmap wont_exit (max_unroll + 1);
+  auto_sbitmap wont_exit (max_unroll + 2);
   bitmap_ones (wont_exit);
 
   auto_vec<edge> remove_edges;