Commit 5ce1ee7f by Richard Sandiford Committed by Richard Sandiford

tree-vect-stmts.c (vectorizable_load): Allocate and free dr_chain within the per-copy loop.

gcc/
	* tree-vect-stmts.c (vectorizable_load): Allocate and free dr_chain
	within the per-copy loop.

From-SVN: r172422
parent 6438fe33
2011-04-14 Richard Sandiford <richard.sandiford@linaro.org> 2011-04-14 Richard Sandiford <richard.sandiford@linaro.org>
* tree-vect-stmts.c (vectorizable_load): Allocate and free dr_chain
within the per-copy loop.
2011-04-14 Richard Sandiford <richard.sandiford@linaro.org>
* tree-vect-stmts.c (vectorizable_load): Print the number of copies * tree-vect-stmts.c (vectorizable_load): Print the number of copies
in the dump file. in the dump file.
......
...@@ -3961,8 +3961,6 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, ...@@ -3961,8 +3961,6 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
} }
else else
vec_num = group_size; vec_num = group_size;
dr_chain = VEC_alloc (tree, heap, vec_num);
} }
else else
{ {
...@@ -4116,6 +4114,9 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, ...@@ -4116,6 +4114,9 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
dataref_ptr = dataref_ptr =
bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt, NULL_TREE); bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt, NULL_TREE);
if (strided_load || slp_perm)
dr_chain = VEC_alloc (tree, heap, vec_num);
for (i = 0; i < vec_num; i++) for (i = 0; i < vec_num; i++)
{ {
if (i > 0) if (i > 0)
...@@ -4325,8 +4326,6 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, ...@@ -4325,8 +4326,6 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
return false; return false;
*vec_stmt = STMT_VINFO_VEC_STMT (stmt_info); *vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
VEC_free (tree, heap, dr_chain);
dr_chain = VEC_alloc (tree, heap, group_size);
} }
else else
{ {
...@@ -4337,11 +4336,10 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, ...@@ -4337,11 +4336,10 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
prev_stmt_info = vinfo_for_stmt (new_stmt); prev_stmt_info = vinfo_for_stmt (new_stmt);
} }
} }
if (dr_chain)
VEC_free (tree, heap, dr_chain);
} }
if (dr_chain)
VEC_free (tree, heap, dr_chain);
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