Consider the following short function: void Tst1(float* __restrict__ SrcP, float* __restrict__ DstP, int Len) { for (int x=0; x<Len; x++) { DstP[x] = SrcP[x] * SrcP[x]; } }
If this function is compiled with: g++41 -O -S TstPow.cpp -ftree-vectorizer-verbose=5 -ftree-vectorize it is vectorized, but if you compile with: g++41 -O -ffast-math -S TstPow.cpp -ftree-vectorizer-verbose=5 -ftree-vectorize it is not with the following output: note: Vectorizing an unaligned access. note: Alignment of access forced using peeling. note: not vectorized: stmt not supported: D.2052_15 = __builtin_powf (D.2051_14, 2.0e+0) note: vectorized 0 loops in function. Michael Cieslinski -- Summary: autovectorisation conflicts with -ffast-math Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: micis at gmx dot de CC: gcc-bugs at gcc dot gnu dot org 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=21465