aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-math-opts.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2014-12-01 17:16:04 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2014-12-01 17:16:04 +0000
commit9370adeb9da5071af3685adbd697784bdd349cc9 (patch)
tree2639c85d255f2ead787a56eafbf7fcf7b8f51bdb /gcc/tree-ssa-math-opts.c
parentdc706721e6e9f2c6c15469c4e65a8f5c64276ec1 (diff)
downloadgcc-9370adeb9da5071af3685adbd697784bdd349cc9.zip
gcc-9370adeb9da5071af3685adbd697784bdd349cc9.tar.gz
gcc-9370adeb9da5071af3685adbd697784bdd349cc9.tar.bz2
PR jit/63854: Fix leak in tree-ssa-math-opts.c
gcc/ChangeLog: PR jit/63854 * tree-ssa-math-opts.c (execute_cse_sincos_1): Fix a missing release of stmts by converting it to an auto_vec. From-SVN: r218230
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r--gcc/tree-ssa-math-opts.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 4b95ee4..1ed2838 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -740,7 +740,7 @@ execute_cse_sincos_1 (tree name)
tree fndecl, res, type;
gimple def_stmt, use_stmt, stmt;
int seen_cos = 0, seen_sin = 0, seen_cexpi = 0;
- vec<gimple> stmts = vNULL;
+ auto_vec<gimple> stmts;
basic_block top_bb = NULL;
int i;
bool cfg_changed = false;
@@ -773,10 +773,7 @@ execute_cse_sincos_1 (tree name)
}
if (seen_cos + seen_sin + seen_cexpi <= 1)
- {
- stmts.release ();
- return false;
- }
+ return false;
/* Simply insert cexpi at the beginning of top_bb but not earlier than
the name def statement. */
@@ -835,8 +832,6 @@ execute_cse_sincos_1 (tree name)
cfg_changed = true;
}
- stmts.release ();
-
return cfg_changed;
}