diff options
author | Dorit Nuzman <dorit@il.ibm.com> | 2006-06-05 08:56:49 +0000 |
---|---|---|
committer | Victor Kaplansky <victork@gcc.gnu.org> | 2006-06-05 08:56:49 +0000 |
commit | a8b28492159212fec3f0faf9dc49c80eef899561 (patch) | |
tree | 7b579571a919fca063460acd57256b51bbf4f7ef /gcc/tree-vectorizer.c | |
parent | 6690a9e079bf15d086d2805d00fea0e228cd7db9 (diff) | |
download | gcc-a8b28492159212fec3f0faf9dc49c80eef899561.zip gcc-a8b28492159212fec3f0faf9dc49c80eef899561.tar.gz gcc-a8b28492159212fec3f0faf9dc49c80eef899561.tar.bz2 |
re PR tree-optimization/26360 (Autovectorization of char -> int loop gets ICE)
Changelog:
PR tree-optimization/26360
* tree-vectorizer.c (destroy_loop_vec_info): Remove (dead) pattern
stmts.
testsuite/Changelog:
PR tree-optimizations/26360
* gcc.dg/vect/vect.exp: Compile tests prefixed with "no-tree-dce"
with -fno-tree-dce.
* gcc.dg/vect/no-tree-dce-pr26360.c: New test.
Co-Authored-By: Victor Kaplansky <victork@il.ibm.com>
From-SVN: r114386
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r-- | gcc/tree-vectorizer.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index b6538a4..c0d7834 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -1467,7 +1467,7 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo) set_stmt_info (ann, NULL); } - for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si)) + for (si = bsi_start (bb); !bsi_end_p (si); ) { tree stmt = bsi_stmt (si); stmt_ann_t ann = stmt_ann (stmt); @@ -1475,10 +1475,28 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo) if (stmt_info) { + /* Check if this is a "pattern stmt" (introduced by the + vectorizer during the pattern recognition pass). */ + bool remove_stmt_p = false; + tree orig_stmt = STMT_VINFO_RELATED_STMT (stmt_info); + if (orig_stmt) + { + stmt_vec_info orig_stmt_info = vinfo_for_stmt (orig_stmt); + if (orig_stmt_info + && STMT_VINFO_IN_PATTERN_P (orig_stmt_info)) + remove_stmt_p = true; + } + + /* Free stmt_vec_info. */ VEC_free (dr_p, heap, STMT_VINFO_SAME_ALIGN_REFS (stmt_info)); free (stmt_info); set_stmt_info ((tree_ann_t)ann, NULL); + + /* Remove dead "pattern stmts". */ + if (remove_stmt_p) + bsi_remove (&si, true); } + bsi_next (&si); } } |