The gcc40 was able to vetorize the simple program given below, gcc41 and gcc42 are failing to vectorize with the message:
novect.cpp:21: note: not vectorized: can't determine dependence between A_4->X[f_9] and C_8->X[f_9] novect.cpp:21: note: vectorized 0 loops in function. Michael Cieslinski <novect.cpp> struct S { enum {count = 40}; typedef struct { double X[count]; } __attribute__(( aligned(16) )) DblAli; struct {double X[count];} aaa __attribute__(( aligned(16) )); struct {double X[count];} bbb __attribute__(( aligned(16) )); struct {double X[count];} ccc __attribute__(( aligned(16) )); void Func (); } __attribute__(( aligned(16) )); void S::Func () { DblAli* __restrict__ A = (DblAli*)(&aaa.X[0]); DblAli* __restrict__ B = (DblAli*)(&bbb.X[0]); DblAli* __restrict__ C = (DblAli*)(&ccc.X[0]); for (int f=0; f<count; f++) { (*C).X[f] = (*A).X[f] * (*B).X[f]; } } -- Summary: Simple loop is no longer vectorized Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: micis at gmx dot de GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26745