From f389e7983bc89fb3d6041d676de7e313892d5ede Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 19 Dec 2017 14:20:07 +0100 Subject: [PATCH] Fix off by one error in loop-unroll.c (PR rtl-optimization/82675). 2017-12-19 Martin Liska PR rtl-optimization/82675 * loop-unroll.c (unroll_loop_constant_iterations): Allocate one more element in sbitmap. From-SVN: r255818 --- gcc/ChangeLog | 6 ++++++ gcc/loop-unroll.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 75c9a222f9f..63b2ff5406f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-12-19 Martin Liska + + PR rtl-optimization/82675 + * loop-unroll.c (unroll_loop_constant_iterations): Allocate one + more element in sbitmap. + 2017-12-19 Paolo Carlini * gimplify.c (gimplify_expr): Use error_operand_p. diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c index cc154da9686..b9d01ffe066 100644 --- a/gcc/loop-unroll.c +++ b/gcc/loop-unroll.c @@ -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 remove_edges; -- 2.30.2