Commit 4f683506 by Eric Botcazou Committed by Eric Botcazou

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
parent ce2c025c
2019-03-19 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/89753
* loop-unroll.c (decide_unroll_constant_iterations): Make guard for
explicit unrolling factor even more robust.
2019-03-19 Jakub Jelinek <jakub@redhat.com>
PR target/89726
......
......@@ -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");
......
2019-03-19 Eric Botcazou <ebotcazou@adacore.com>
* c-c++-common/unroll-7.c: New test.
2019-03-19 Jakub Jelinek <jakub@redhat.com>
PR target/89726
......
/* { dg-do compile } */
/* { dg-options "-O -fno-tree-dominator-opts" } */
int nv;
void test (void)
{
#pragma GCC unroll 2
for (nv = 0; nv < 1; ++nv)
{}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment