[PATCH] Don't leak DEP_REPLACE memory (PR middle-end/56461)

Jakub Jelinek jakub@redhat.com
Tue Feb 26 21:29:00 GMT 2013


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.

--- 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);

	Jakub



More information about the Gcc-patches mailing list