loop-doloop.c (doloop_valid_p): Make sure that body gets freed.

2004-05-07  Andrew Pinski  <pinskia@physics.uc.edu>

        * loop-doloop.c (doloop_valid_p): Make sure that body
        gets freed.

From-SVN: r81619
This commit is contained in:
Andrew Pinski 2004-05-07 14:17:33 +00:00 committed by Andrew Pinski
parent bfb23806b8
commit 7600f0944b
2 changed files with 16 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2004-05-07 Andrew Pinski <pinskia@physics.uc.edu>
* loop-doloop.c (doloop_valid_p): Make sure that body
gets freed.
2004-05-07 Eric Botcazou <ebotcazou@act-europe.fr>
* config/sparc/sparc-protos.h (sparc_skip_caller_unimp): New

View File

@ -144,6 +144,7 @@ doloop_valid_p (struct loop *loop, struct niter_desc *desc)
basic_block *body = get_loop_body (loop), bb;
rtx insn;
unsigned i;
bool result = true;
/* Check for loops that may not terminate under special conditions. */
if (!desc->simple_p
@ -174,7 +175,8 @@ doloop_valid_p (struct loop *loop, struct niter_desc *desc)
enable count-register loops in this case. */
if (dump_file)
fprintf (dump_file, "Doloop: Possible infinite iteration case.\n");
return false;
result = false;
goto cleanup;
}
for (i = 0; i < loop->num_nodes; i++)
@ -191,7 +193,8 @@ doloop_valid_p (struct loop *loop, struct niter_desc *desc)
{
if (dump_file)
fprintf (dump_file, "Doloop: Function call in loop.\n");
return false;
result = false;
goto cleanup;
}
/* Some targets (eg, PPC) use the count register for branch on table
@ -202,13 +205,17 @@ doloop_valid_p (struct loop *loop, struct niter_desc *desc)
{
if (dump_file)
fprintf (dump_file, "Doloop: Computed branch in the loop.\n");
return false;
result = false;
goto cleanup;
}
}
}
result = true;
cleanup:
free (body);
return true;
return result;
}
/* Adds test of COND jumping to DEST to the end of BB. */