http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57579
Bug ID: 57579 Summary: Problem with vectorization Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.carminati at cern dot ch Good evening, all my apologises if this is a stupid question, however I have a terribly simple loop include <math.h> typedef struct { double x,y,z; double dummy; } P; void foo(const P * __restrict__ points, double * __restrict__ d) { for(int i=0;i<100;++i) { d[i]=points[i].x*points[i].x*points[i].x*points[i].x+ points[i].y*points[i].y*points[i].y+ points[i].z*points[i].z*points[i].z; } } if I compile with /opt/gcc-4.8.1/bin/g++ -c -std=c++0x -O3 -msse4.1 -Wall -Wstrict-aliasing=2 -ftree-vectorizer-verbose=2 I obtain the diagnostic at the bottom of the page. Is there a place where I can find an explanation for the g++ vectorizer diagnostic messages? I frankly do not understand what it is talking about and google does not seem to be willing to help me this time. Any help in deciphering these messages would be greatly appreciated. Thanks and sorry for the bother Analyzing loop at testvec1.cxx:12 testvec1.cxx:12: note: Data access with gaps requires scalar epilogue loop testvec1.cxx:12: note: vector alignment may not be reachable testvec1.cxx:12: note: virtual phi. skip. testvec1.cxx:12: note: not ssa-name. testvec1.cxx:12: note: use not simple. testvec1.cxx:12: note: not ssa-name. testvec1.cxx:12: note: use not simple. testvec1.cxx:12: note: no array mode for V2DF[4] testvec1.cxx:12: note: not ssa-name. testvec1.cxx:12: note: use not simple. testvec1.cxx:12: note: not ssa-name. testvec1.cxx:12: note: use not simple. testvec1.cxx:12: note: no array mode for V2DF[4] testvec1.cxx:12: note: not ssa-name. testvec1.cxx:12: note: use not simple. testvec1.cxx:12: note: not ssa-name. testvec1.cxx:12: note: use not simple. testvec1.cxx:12: note: no array mode for V2DF[4] Vectorizing loop at testvec1.cxx:12 testvec1.cxx:12: note: virtual phi. skip. testvec1.cxx:12: note: no array mode for V2DF[4] testvec1.cxx:12: note: no array mode for V2DF[4] testvec1.cxx:12: note: no array mode for V2DF[4] testvec1.cxx:10: note: vectorized 1 loops in function. testvec1.cxx:10: note: not vectorized: not enough data-refs in basic block. testvec1.cxx:13: note: not vectorized: no vectype for stmt: vect_var_.10_29 = MEM[(const struct P *)vect_ppoints.6_31]; scalar_type: const vector(2) double testvec1.cxx:13: note: Failed to SLP the basic block. testvec1.cxx:13: note: not vectorized: failed to find SLP opportunities in basic block. testvec1.cxx:13: note: Build SLP failed: grouped loads have gaps _59 = _60->x; testvec1.cxx:13: note: Failed to SLP the basic block. testvec1.cxx:13: note: not vectorized: failed to find SLP opportunities in basic block. testvec1.cxx:10: note: not vectorized: not enough data-refs in basic block.