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
Confirmed.
*** Bug 28524 has been marked as a duplicate of this bug. ***
the vectorizer should recognize this particular case or we might want to expand pow() again at the tree level before the vectorizer.
i had a patch to expand pow at the tree level, but it conflicted with fold (which consistently tried to rebuild pow function calls). the outcome might be better now that we have PAREN_EXPR, though.
Fixed for a while now.