This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix off by one error in loop-unroll.c (PR rtl-optimization/82675).
- From: Martin Liška <mliska at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 Dec 2017 08:56:16 +0100
- Subject: [PATCH] Fix off by one error in loop-unroll.c (PR rtl-optimization/82675).
- Authentication-results: sourceware.org; auth=none
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 <mliska@suse.cz>
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;