Fix memory leak in tree-vect-stmts.c

* tree-vect-stmts.c (vectorizable_simd_clone_call): Utilize
	auto_vec instead of vec.

From-SVN: r236472
This commit is contained in:
Martin Liska 2016-05-19 17:08:02 +02:00 committed by Martin Liska
parent 4089c3402c
commit 00426f9a9e
2 changed files with 10 additions and 16 deletions

View file

@ -1,3 +1,8 @@
2016-05-19 Martin Liska <mliska@suse.cz>
* tree-vect-stmts.c (vectorizable_simd_clone_call): Utilize
auto_vec instead of vec.
2016-05-19 Martin Liska <mliska@suse.cz>
* tree-parloops.c (oacc_entry_exit_ok): Release a vector.

View file

@ -2755,7 +2755,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
gimple *def_stmt;
gimple *new_stmt = NULL;
int ncopies, j;
vec<simd_call_arg_info> arginfo = vNULL;
auto_vec<simd_call_arg_info> arginfo;
vec<tree> vargs = vNULL;
size_t i, nargs;
tree lhs, rtype, ratype;
@ -2802,7 +2802,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
if (nargs == 0)
return false;
arginfo.create (nargs);
arginfo.reserve (nargs, true);
for (i = 0; i < nargs; i++)
{
@ -2822,7 +2822,6 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"use not simple.\n");
arginfo.release ();
return false;
}
@ -2978,10 +2977,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
}
if (bestn == NULL)
{
arginfo.release ();
return false;
}
return false;
for (i = 0; i < nargs; i++)
if ((arginfo[i].dt == vect_constant_def
@ -2994,10 +2990,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
if (arginfo[i].vectype == NULL
|| (TYPE_VECTOR_SUBPARTS (arginfo[i].vectype)
> bestn->simdclone->simdlen))
{
arginfo.release ();
return false;
}
return false;
}
fndecl = bestn->decl;
@ -3009,10 +3002,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
performed using SIMD instructions. */
if ((loop == NULL || (unsigned) loop->safelen < nunits)
&& gimple_vuse (stmt))
{
arginfo.release ();
return false;
}
return false;
/* Sanity check: make sure that at least one copy of the vectorized stmt
needs to be generated. */
@ -3041,7 +3031,6 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
dump_printf_loc (MSG_NOTE, vect_location,
"=== vectorizable_simd_clone_call ===\n");
/* vect_model_simple_cost (stmt_info, ncopies, dt, NULL, NULL); */
arginfo.release ();
return true;
}