summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-11-10 09:29:52 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-11-10 09:29:52 +0100
commit78048b1c66c31b87770b8a29fa44fc291213fd9b (patch)
tree17a0e0e6943fabe7f2cd14633582a9f31eb0a0ed /gcc/tree-vect-stmts.c
parent136a1c15d70712b65429ca8028fb2fe2d38df501 (diff)
downloadgcc-78048b1c66c31b87770b8a29fa44fc291213fd9b.tar.gz
re PR tree-optimization/51000 (ICE: in vect_get_store_cost, at tree-vect-stmts.c:923 on powerpc-apple-darwin9)
PR tree-optimization/51000 * tree-vect-patterns.c (vect_recog_bool_pattern): If adding a pattern stmt for a bool store, adjust DR_STMT too. Don't handle bool conversions to single bit precision lhs. * tree-vect-stmts.c (vect_remove_stores): If next is a pattern stmt, remove its related stmt and free its stmt_vinfo. (free_stmt_vec_info): Free also pattern stmt's vinfo and pattern def stmt's vinfo. * tree-vect-loop.c (destroy_loop_vec_info): Don't try to free pattern stmt's vinfo here. (vect_transform_loop): When calling vect_remove_stores, do gsi_next first and don't call gsi_remove. If not strided store, free stmt vinfo for gsi_stmt (si) rather than stmt. * gcc.dg/vect/pr51000.c: New test. From-SVN: r181250
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 705e7df531a..abccd923b44 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -5567,10 +5567,14 @@ vect_remove_stores (gimple first_stmt)
while (next)
{
+ stmt_vec_info stmt_info = vinfo_for_stmt (next);
+
+ tmp = GROUP_NEXT_ELEMENT (stmt_info);
+ if (is_pattern_stmt_p (stmt_info))
+ next = STMT_VINFO_RELATED_STMT (stmt_info);
/* Free the attached stmt_vec_info and remove the stmt. */
next_si = gsi_for_stmt (next);
gsi_remove (&next_si, true);
- tmp = GROUP_NEXT_ELEMENT (vinfo_for_stmt (next));
free_stmt_vec_info (next);
next = tmp;
}
@@ -5660,6 +5664,22 @@ free_stmt_vec_info (gimple stmt)
if (!stmt_info)
return;
+ /* Check if this statement has a related "pattern stmt"
+ (introduced by the vectorizer during the pattern recognition
+ pass). Free pattern's stmt_vec_info and def stmt's stmt_vec_info
+ too. */
+ if (STMT_VINFO_IN_PATTERN_P (stmt_info))
+ {
+ stmt_vec_info patt_info
+ = vinfo_for_stmt (STMT_VINFO_RELATED_STMT (stmt_info));
+ if (patt_info)
+ {
+ if (STMT_VINFO_PATTERN_DEF_STMT (patt_info))
+ free_stmt_vec_info (STMT_VINFO_PATTERN_DEF_STMT (patt_info));
+ free_stmt_vec_info (STMT_VINFO_RELATED_STMT (stmt_info));
+ }
+ }
+
VEC_free (dr_p, heap, STMT_VINFO_SAME_ALIGN_REFS (stmt_info));
set_vinfo_for_stmt (stmt, NULL);
free (stmt_info);