diff mbox

[2/n] Fix minor SSA_NAME leaks

Message ID 5616D1A9.1040202@redhat.com
State New
Headers show

Commit Message

Jeff Law Oct. 8, 2015, 8:27 p.m. UTC
Another fairly obvious leak, this time in tree-ssa-dse.c where we again 
call gsi_remove without an associated release_defs.

The only thing of note here is this time we have virtual operations on 
the statement.  So before we call gsi_remove and release_defs, we have 
to call unlink_stmt_vdef to propagate away the uses of the VDEF.

tree-ssa-dse properly calls unlink_stmt_vdef, so the right things are 
happening as far as that's concerned.

Like the previous patch, I do have a minimized test, but it's unclear 
how we'd really want to put this into a testing harness at this point. 
If we get to an enforced no-leak policy in the manager, then these tests 
can just drop in as compile tests.  Or perhaps as a plug-in test where 
we can check the state of the name manager.

Anyway, bootstrapped and regression tested on x86_64-linux-gnu. 
Installed on the trunk.

Jeff
commit edf28250d6a25393684ee0e28f87fafe57183f76
Author: Jeff Law <law@redhat.com>
Date:   Thu Oct 8 14:25:42 2015 -0600

    [PATCH] [2/n] Fix minor SSA_NAME leaks
    
    	* tree-ssa-dse.c (dse_optimize_stmt): Add missing call to
    	release_defs.
diff mbox

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4286491..64309c1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@ 
+2015-10-08  Jeff Law  <law@redhat.com>
+
+	* tree-ssa-dse.c (dse_optimize_stmt): Add missing call to
+	release_defs.
+
 2015-10-08  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* config/i386/i386.c (ix86_compute_frame_layout): Round up the
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index ac9c05a..80ebdb6 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -271,6 +271,7 @@  dse_optimize_stmt (gimple_stmt_iterator *gsi)
 		  /* Remove the dead store.  */
 		  if (gsi_remove (gsi, true))
 		    bitmap_set_bit (need_eh_cleanup, gimple_bb (stmt)->index);
+		  release_defs (stmt);
 		}
 	      break;
 	    }