http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56624
Bug #: 56624 Summary: Vectorizer gives up on a group-access if it contains stores to the same location Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: michael.v.zolotuk...@gmail.com Build: 4.8.0 20130313 Created attachment 29672 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29672 Reproducer GCC can't vectorize such loop: void foo (double *a) { int i; for (i = 0; i < 100; i+=2) { a[i+1] = 2; a[i] = 3; a[i+1] = 2; a[i] = 3; } } Vectorizer reports following: note: === vect_analyze_data_ref_accesses === note: Detected interleaving of size 2 note: Two store stmts share the same dr. note: not vectorized: complicated access pattern. Obviously, in this given case vectorization is possible because the first stores have no effect. This test is a reproducer of similar problem encountered on Spec2006/470.lbm - there if-conversion could produce stores to the same location which will stop vectorizer. The test is attached, command line to reproduce: gcc group_access.c -O3 -c -ftree-vectorizer-verbose=15