aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop-unroll.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/loop-unroll.c')
-rw-r--r--gcc/loop-unroll.c2
1 files changed, 1 insertions, 1 deletions
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");