summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-14 11:54:30 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-14 11:54:30 +0000
commit362eeee72ee3bf4951cd0b168efe6552f5a0c2cd (patch)
treeb71a2da6bf826c44d0ffe09bd7c48e495a212e53
parent0ffb7cb0140758d740c361942fa87632ee840244 (diff)
downloadgcc-362eeee72ee3bf4951cd0b168efe6552f5a0c2cd.tar.gz
gcc/
* tree-vect-stmts.c (vectorizable_load): Allocate and free dr_chain within the per-copy loop. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172422 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-vect-stmts.c12
2 files changed, 10 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f813f740778..572b6affd33 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
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
in the dump file.
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 9e9a0bbe2f3..eeb922377a8 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -3961,8 +3961,6 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
}
else
vec_num = group_size;
-
- dr_chain = VEC_alloc (tree, heap, vec_num);
}
else
{
@@ -4116,6 +4114,9 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
dataref_ptr =
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++)
{
if (i > 0)
@@ -4325,8 +4326,6 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
return false;
*vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
- VEC_free (tree, heap, dr_chain);
- dr_chain = VEC_alloc (tree, heap, group_size);
}
else
{
@@ -4337,11 +4336,10 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_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;
}