summaryrefslogtreecommitdiff
path: root/gcc/loop-doloop.c
diff options
context:
space:
mode:
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-07 14:17:33 +0000
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-07 14:17:33 +0000
commit7caa482e230a774d71c0d31b491e067e8ea3c781 (patch)
tree4cc983a57f864d7e4239d0a5eaa6a59bf033f11a /gcc/loop-doloop.c
parent954084b8fae13050db81544dffe3c915f0fc385e (diff)
downloadgcc-7caa482e230a774d71c0d31b491e067e8ea3c781.tar.gz
2004-05-07 Andrew Pinski <pinskia@physics.uc.edu>
* loop-doloop.c (doloop_valid_p): Make sure that body gets freed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81619 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop-doloop.c')
-rw-r--r--gcc/loop-doloop.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/loop-doloop.c b/gcc/loop-doloop.c
index fa6b55b3cfa..d8d3edf500e 100644
--- a/gcc/loop-doloop.c
+++ b/gcc/loop-doloop.c
@@ -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. */