From 4f683506df6ae4137d5cd362ccb8a50302cf8a2d Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 19 Mar 2019 08:06:48 +0000 Subject: re PR rtl-optimization/89753 (ICE in unroll_loop_constant_iterations, at loop-unroll.c:498) PR rtl-optimization/89753 * loop-unroll.c (decide_unroll_constant_iterations): Make guard for explicit unrolling factor even more robust. From-SVN: r269791 --- gcc/loop-unroll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/loop-unroll.c') diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c index 0164762..bc7840e 100644 --- a/gcc/loop-unroll.c +++ b/gcc/loop-unroll.c @@ -400,7 +400,7 @@ decide_unroll_constant_iterations (struct loop *loop, int flags) { /* However we cannot unroll completely at the RTL level a loop with constant number of iterations; it should have been peeled instead. */ - if ((unsigned) loop->unroll > desc->niter - 1) + if (desc->niter == 0 || (unsigned) loop->unroll > desc->niter - 1) { if (dump_file) fprintf (dump_file, ";; Loop should have been peeled\n"); -- cgit v1.1