aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-ivopts.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2015-12-09 10:38:53 +0100
committerMartin Liska <marxin@gcc.gnu.org>2015-12-09 09:38:53 +0000
commit74fbae9278d935f5623498edc2235fcbba4f9578 (patch)
treefb7947be8a3f4d0a15355104b20479f9e247ed09 /gcc/tree-ssa-loop-ivopts.c
parentd2b04f0b7beb7d153e31fb956e4580dbf6c99c8c (diff)
downloadgcc-74fbae9278d935f5623498edc2235fcbba4f9578.zip
gcc-74fbae9278d935f5623498edc2235fcbba4f9578.tar.gz
gcc-74fbae9278d935f5623498edc2235fcbba4f9578.tar.bz2
Fix newly introduced memory leak in
* hash-traits.h (struct typed_delete_remove): New function. (typed_delete_remove ::remove): Likewise. * tree-ssa-loop-ivopts.c (struct iv_common_cand): Replace auto_vec with vec. (record_common_cand): Replace XNEW with operator new. From-SVN: r231448
Diffstat (limited to 'gcc/tree-ssa-loop-ivopts.c')
-rw-r--r--gcc/tree-ssa-loop-ivopts.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 98dc451..d7a0e9e 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -253,13 +253,13 @@ struct iv_common_cand
tree base;
tree step;
/* IV uses from which this common candidate is derived. */
- vec<iv_use *> uses;
+ auto_vec<iv_use *> uses;
hashval_t hash;
};
/* Hashtable helpers. */
-struct iv_common_cand_hasher : free_ptr_hash <iv_common_cand>
+struct iv_common_cand_hasher : delete_ptr_hash <iv_common_cand>
{
static inline hashval_t hash (const iv_common_cand *);
static inline bool equal (const iv_common_cand *, const iv_common_cand *);
@@ -3127,7 +3127,7 @@ record_common_cand (struct ivopts_data *data, tree base,
slot = data->iv_common_cand_tab->find_slot (&ent, INSERT);
if (*slot == NULL)
{
- *slot = XNEW (struct iv_common_cand);
+ *slot = new iv_common_cand ();
(*slot)->base = base;
(*slot)->step = step;
(*slot)->uses.create (8);