Commit 00426f9a by Martin Liska Committed by Martin Liska

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
parent 4089c340
2016-05-19 Martin Liska <mliska@suse.cz> 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. * tree-parloops.c (oacc_entry_exit_ok): Release a vector.
2016-05-19 Martin Liska <mliska@suse.cz> 2016-05-19 Martin Liska <mliska@suse.cz>
......
...@@ -2755,7 +2755,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi, ...@@ -2755,7 +2755,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
gimple *def_stmt; gimple *def_stmt;
gimple *new_stmt = NULL; gimple *new_stmt = NULL;
int ncopies, j; int ncopies, j;
vec<simd_call_arg_info> arginfo = vNULL; auto_vec<simd_call_arg_info> arginfo;
vec<tree> vargs = vNULL; vec<tree> vargs = vNULL;
size_t i, nargs; size_t i, nargs;
tree lhs, rtype, ratype; tree lhs, rtype, ratype;
...@@ -2802,7 +2802,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi, ...@@ -2802,7 +2802,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
if (nargs == 0) if (nargs == 0)
return false; return false;
arginfo.create (nargs); arginfo.reserve (nargs, true);
for (i = 0; i < nargs; i++) for (i = 0; i < nargs; i++)
{ {
...@@ -2822,7 +2822,6 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi, ...@@ -2822,7 +2822,6 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
if (dump_enabled_p ()) if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"use not simple.\n"); "use not simple.\n");
arginfo.release ();
return false; return false;
} }
...@@ -2978,10 +2977,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi, ...@@ -2978,10 +2977,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
} }
if (bestn == NULL) if (bestn == NULL)
{ return false;
arginfo.release ();
return false;
}
for (i = 0; i < nargs; i++) for (i = 0; i < nargs; i++)
if ((arginfo[i].dt == vect_constant_def if ((arginfo[i].dt == vect_constant_def
...@@ -2994,10 +2990,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi, ...@@ -2994,10 +2990,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
if (arginfo[i].vectype == NULL if (arginfo[i].vectype == NULL
|| (TYPE_VECTOR_SUBPARTS (arginfo[i].vectype) || (TYPE_VECTOR_SUBPARTS (arginfo[i].vectype)
> bestn->simdclone->simdlen)) > bestn->simdclone->simdlen))
{ return false;
arginfo.release ();
return false;
}
} }
fndecl = bestn->decl; fndecl = bestn->decl;
...@@ -3009,10 +3002,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi, ...@@ -3009,10 +3002,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
performed using SIMD instructions. */ performed using SIMD instructions. */
if ((loop == NULL || (unsigned) loop->safelen < nunits) if ((loop == NULL || (unsigned) loop->safelen < nunits)
&& gimple_vuse (stmt)) && gimple_vuse (stmt))
{ return false;
arginfo.release ();
return false;
}
/* Sanity check: make sure that at least one copy of the vectorized stmt /* Sanity check: make sure that at least one copy of the vectorized stmt
needs to be generated. */ needs to be generated. */
...@@ -3041,7 +3031,6 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi, ...@@ -3041,7 +3031,6 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
dump_printf_loc (MSG_NOTE, vect_location, dump_printf_loc (MSG_NOTE, vect_location,
"=== vectorizable_simd_clone_call ===\n"); "=== vectorizable_simd_clone_call ===\n");
/* vect_model_simple_cost (stmt_info, ncopies, dt, NULL, NULL); */ /* vect_model_simple_cost (stmt_info, ncopies, dt, NULL, NULL); */
arginfo.release ();
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment