Patchwork Don't leak DEP_REPLACE memory (PR middle-end/56461)

login
register
mail settings
Submitter Jakub Jelinek
Date Feb. 26, 2013, 9:28 p.m.
Message ID <20130226212848.GF12913@tucnak.redhat.com>
Download mbox | patch
Permalink /patch/223408/
State New
Headers show

Comments

Jakub Jelinek - Feb. 26, 2013, 9:28 p.m.
Hi!

DEP_REPLACE is never being freed.  This patch fixes that.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

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

	PR middle-end/56461
	* sched-deps.c (delete_dep_node): Free DEP_REPLACE.


	Jakub

Patch

--- gcc/sched-deps.c.jj	2013-02-25 13:08:44.000000000 +0100
+++ gcc/sched-deps.c	2013-02-26 17:45:37.398849991 +0100
@@ -352,6 +352,8 @@  delete_dep_node (dep_node_t n)
   gcc_assert (dep_link_is_detached_p (DEP_NODE_BACK (n))
 	      && dep_link_is_detached_p (DEP_NODE_FORW (n)));
 
+  XDELETE (DEP_REPLACE (DEP_NODE_DEP (n)));
+
   --dn_pool_diff;
 
   pool_free (dn_pool, n);