Patchwork Fix maybe_lower_iteration_bound leak (PR middle-end/56461)

login
register
mail settings
Submitter Jakub Jelinek
Date Feb. 27, 2013, 8:19 p.m.
Message ID <20130227201926.GP12913@tucnak.redhat.com>
Download mbox | patch
Permalink /patch/223694/
State New
Headers show

Comments

Jakub Jelinek - Feb. 27, 2013, 8:19 p.m.
Hi!

This function leaks the not_executed_last_iteration pointer set.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?

2013-02-27  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/56461
	* tree-ssa-loop-niter.c (maybe_lower_iteration_bound): Call
	pointer_set_destroy on not_executed_last_iteration.


	Jakub
Jeff Law - Feb. 27, 2013, 10 p.m.
On 02/27/2013 01:19 PM, Jakub Jelinek wrote:
> Hi!
>
> This function leaks the not_executed_last_iteration pointer set.
>
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk?
>
> 2013-02-27  Jakub Jelinek  <jakub@redhat.com>
>
> 	PR middle-end/56461
> 	* tree-ssa-loop-niter.c (maybe_lower_iteration_bound): Call
> 	pointer_set_destroy on not_executed_last_iteration.
OK.
Jeff

Patch

--- gcc/tree-ssa-loop-niter.c.jj	2013-01-31 12:28:56.000000000 +0100
+++ gcc/tree-ssa-loop-niter.c	2013-02-27 17:29:57.155507388 +0100
@@ -3293,6 +3293,7 @@  maybe_lower_iteration_bound (struct loop
     }
   BITMAP_FREE (visited);
   queue.release ();
+  pointer_set_destroy (not_executed_last_iteration);
 }
 
 /* Records estimates on numbers of iterations of LOOP.  If USE_UNDEFINED_P