* [PATCH] Fix memory leak in tree_estimate_loop_size (PR middle-end/56461)
@ 2013-03-01 20:18 Jakub Jelinek
2013-03-01 23:24 ` Jeff Law
2013-03-04 10:00 ` Richard Biener
0 siblings, 2 replies; 3+ messages in thread
From: Jakub Jelinek @ 2013-03-01 20:18 UTC (permalink / raw)
To: Richard Biener; +Cc: gcc-patches
Hi!
path vector has been only released when return false; later in the function,
but not in this case. Bootstrapped/regtested on x86_64-linux and
i686-linux, ok for trunk?
2013-03-01 Jakub Jelinek <jakub@redhat.com>
PR middle-end/56461
* tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Release path
vector even when returning true. Fix up function comment formatting.
--- gcc/tree-ssa-loop-ivcanon.c.jj 2013-01-11 09:02:48.000000000 +0100
+++ gcc/tree-ssa-loop-ivcanon.c 2013-03-01 17:16:51.955088637 +0100
@@ -207,7 +207,7 @@ constant_after_peeling (tree op, gimple
EDGE_TO_CANCEL (if non-NULL) is an non-exit edge eliminated in the last iteration
of loop.
Return results in SIZE, estimate benefits for complete unrolling exiting by EXIT.
- Stop estimating after UPPER_BOUND is met. Return true in this case */
+ Stop estimating after UPPER_BOUND is met. Return true in this case. */
static bool
tree_estimate_loop_size (struct loop *loop, edge exit, edge edge_to_cancel, struct loop_size *size,
@@ -321,6 +321,7 @@ tree_estimate_loop_size (struct loop *lo
- size->last_iteration_eliminated_by_peeling) > upper_bound)
{
free (body);
+ path.release ();
return true;
}
}
Jakub
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix memory leak in tree_estimate_loop_size (PR middle-end/56461)
2013-03-01 20:18 [PATCH] Fix memory leak in tree_estimate_loop_size (PR middle-end/56461) Jakub Jelinek
@ 2013-03-01 23:24 ` Jeff Law
2013-03-04 10:00 ` Richard Biener
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Law @ 2013-03-01 23:24 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: Richard Biener, gcc-patches
On 03/01/2013 01:18 PM, Jakub Jelinek wrote:
> Hi!
>
> path vector has been only released when return false; later in the function,
> but not in this case. Bootstrapped/regtested on x86_64-linux and
> i686-linux, ok for trunk?
>
> 2013-03-01 Jakub Jelinek <jakub@redhat.com>
>
> PR middle-end/56461
> * tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Release path
> vector even when returning true. Fix up function comment formatting.
OK.
Jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix memory leak in tree_estimate_loop_size (PR middle-end/56461)
2013-03-01 20:18 [PATCH] Fix memory leak in tree_estimate_loop_size (PR middle-end/56461) Jakub Jelinek
2013-03-01 23:24 ` Jeff Law
@ 2013-03-04 10:00 ` Richard Biener
1 sibling, 0 replies; 3+ messages in thread
From: Richard Biener @ 2013-03-04 10:00 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: gcc-patches
On Fri, 1 Mar 2013, Jakub Jelinek wrote:
> Hi!
>
> path vector has been only released when return false; later in the function,
> but not in this case. Bootstrapped/regtested on x86_64-linux and
> i686-linux, ok for trunk?
Ok.
Thanks,
Richard.
> 2013-03-01 Jakub Jelinek <jakub@redhat.com>
>
> PR middle-end/56461
> * tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Release path
> vector even when returning true. Fix up function comment formatting.
>
> --- gcc/tree-ssa-loop-ivcanon.c.jj 2013-01-11 09:02:48.000000000 +0100
> +++ gcc/tree-ssa-loop-ivcanon.c 2013-03-01 17:16:51.955088637 +0100
> @@ -207,7 +207,7 @@ constant_after_peeling (tree op, gimple
> EDGE_TO_CANCEL (if non-NULL) is an non-exit edge eliminated in the last iteration
> of loop.
> Return results in SIZE, estimate benefits for complete unrolling exiting by EXIT.
> - Stop estimating after UPPER_BOUND is met. Return true in this case */
> + Stop estimating after UPPER_BOUND is met. Return true in this case. */
>
> static bool
> tree_estimate_loop_size (struct loop *loop, edge exit, edge edge_to_cancel, struct loop_size *size,
> @@ -321,6 +321,7 @@ tree_estimate_loop_size (struct loop *lo
> - size->last_iteration_eliminated_by_peeling) > upper_bound)
> {
> free (body);
> + path.release ();
> return true;
> }
> }
>
> Jakub
>
>
--
Richard Biener <rguenther@suse.de>
SUSE / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746
GF: Jeff Hawn, Jennifer Guild, Felix Imend
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-04 10:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-01 20:18 [PATCH] Fix memory leak in tree_estimate_loop_size (PR middle-end/56461) Jakub Jelinek
2013-03-01 23:24 ` Jeff Law
2013-03-04 10:00 ` Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).