Hello. Following patch fixes off by one in loop unroller where wont_exit has not enough elements that are later on asked for.
Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. Ready to be installed? Martin gcc/ChangeLog: 2017-11-08 Martin Liska <[email protected]> PR rtl-optimization/82675 * loop-unroll.c (unroll_loop_constant_iterations): Allocate one more element in sbitmap. --- gcc/loop-unroll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c index 91bf5dddeed..2fab92bcf74 100644 --- a/gcc/loop-unroll.c +++ b/gcc/loop-unroll.c @@ -477,7 +477,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;
