aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2015-10-08 23:09:56 -0600
committerJeff Law <law@gcc.gnu.org>2015-10-08 23:09:56 -0600
commit2795c84a46d65e5a4bbb548438da597c5863cad9 (patch)
tree843afaa6d46f2195531301e8910ea6252e2b6d26
parent83ebb841f0cac719fd0e218ba88e9e297bb8ac76 (diff)
downloadgcc-2795c84a46d65e5a4bbb548438da597c5863cad9.zip
gcc-2795c84a46d65e5a4bbb548438da597c5863cad9.tar.gz
gcc-2795c84a46d65e5a4bbb548438da597c5863cad9.tar.bz2
[PATCH] [5/n] Fix minor SSA_NAME leaks
* value-prof.c (gimple_ic): Add missing calls to unlink_stmt_vdef and release_ssa_name in two places. (gimple_stringop_fixed_value): Similarly. From-SVN: r228632
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/value-prof.c15
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8ba1603..a1b9d1b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -5,6 +5,10 @@
2015-10-08 Jeff Law <law@redhat.com>
+ * value-prof.c (gimple_ic): Add missing calls to unlink_stmt_vdef
+ and release_ssa_name in two places.
+ (gimple_stringop_fixed_value): Similarly.
+
* tree-ssa-loop-im.c (rewrite_bittest): Add missing call to
release_defs.
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 90211ef..ddf1215 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -1384,6 +1384,11 @@ gimple_ic (gcall *icall_stmt, struct cgraph_node *direct_call,
cond_stmt = gimple_build_cond (EQ_EXPR, tmp1, tmp0, NULL_TREE, NULL_TREE);
gsi_insert_before (&gsi, cond_stmt, GSI_SAME_STMT);
+ if (TREE_CODE (gimple_vdef (icall_stmt)) == SSA_NAME)
+ {
+ unlink_stmt_vdef (icall_stmt);
+ release_ssa_name (gimple_vdef (icall_stmt));
+ }
gimple_set_vdef (icall_stmt, NULL_TREE);
gimple_set_vuse (icall_stmt, NULL_TREE);
update_stmt (icall_stmt);
@@ -1472,6 +1477,11 @@ gimple_ic (gcall *icall_stmt, struct cgraph_node *direct_call,
{
gimple *copy;
+ if (TREE_CODE (gimple_vdef (iretbnd_stmt)) == SSA_NAME)
+ {
+ unlink_stmt_vdef (iretbnd_stmt);
+ release_ssa_name (gimple_vdef (iretbnd_stmt));
+ }
gimple_set_vdef (iretbnd_stmt, NULL_TREE);
gimple_set_vuse (iretbnd_stmt, NULL_TREE);
update_stmt (iretbnd_stmt);
@@ -1698,6 +1708,11 @@ gimple_stringop_fixed_value (gcall *vcall_stmt, tree icall_size, int prob,
cond_stmt = gimple_build_cond (EQ_EXPR, tmp1, tmp0, NULL_TREE, NULL_TREE);
gsi_insert_before (&gsi, cond_stmt, GSI_SAME_STMT);
+ if (TREE_CODE (gimple_vdef (vcall_stmt)) == SSA_NAME)
+ {
+ unlink_stmt_vdef (vcall_stmt);
+ release_ssa_name (gimple_vdef (vcall_stmt));
+ }
gimple_set_vdef (vcall_stmt, NULL);
gimple_set_vuse (vcall_stmt, NULL);
update_stmt (vcall_stmt);