https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63175
--- Comment #19 from rguenther at suse dot de <rguenther at suse dot de> --- On Mon, 2 Mar 2015, rguenther at suse dot de wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63175 > > --- Comment #18 from rguenther at suse dot de <rguenther at suse dot de> --- > On Mon, 2 Mar 2015, msebor at gcc dot gnu.org wrote: > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63175 > > > > --- Comment #17 from Martin Sebor <msebor at gcc dot gnu.org> --- > > Following up on my comment #14, and as requested on gcc-patches, the test > > case > > below is vectorized with GCC 4.8.2 for T being either 32 bits wide (e.g., > > int) > > or 64-bits wide (e.g., long or long long) but not with the fix referenced in > > comment #13. The difference between the test in costmodel-bb-slp-9a.c and > > the > > code here is that unlike the source, the destination of the copy isn't > > aligned > > on an even element boundary. > > > > const T a [] = { 1, 2, 3, 4, 5 }; > > extern T b[sizeof a / sizeof *a]; > > > > void g (void) > > { > > const T *p = a; > > T *q = b + 1; > > > > *q++ = *p++; > > *q++ = *p++; > > *q++ = *p++; > > *q++ = *p++; > > } > > > > In addition to this failure (mentioned on the list) the latest trunk also > > fails > > to vectorize the following code which is successfully vectorized by 4.8.2. > > The > > difference is that the arrays are only declared here while in > > costmodel-bb-slp-9a.c they are defined. I only noticed this now, and so > > it's > > not being exercised in the proposed enhanced test submitted to gcc-patches > > last > > Friday, > > > > extern const T a []; > > extern T b[]; > > > > void g (void) > > { > > const T *p = a + 1; > > T *q = b; > > > > *q++ = *p++; > > *q++ = *p++; > > *q++ = *p++; > > *q++ = *p++; > > } > > Both is because powerpc simply cannot handle unaligned stores and > in neither testcase we can force its alignemnt (it's "extern", and > for the first case aligning the first element won't align the > vector store) How does GCC 4.8 generated vectorized code look like?