From 9370adeb9da5071af3685adbd697784bdd349cc9 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 1 Dec 2014 17:16:04 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++++ gcc/tree-ssa-math-opts.c | 9 ++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 695bfd1fa53..6063549cd28 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-12-01 David Malcolm + + 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. + 2014-12-01 Richard Biener * Makefile.in (gimple-match.o-warn): Use -Wno-unused instead of diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c index 4b95ee48377..1ed2838f1da 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 stmts = vNULL; + auto_vec 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; } -- 2.30.2