https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118175
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2024-12-23 Ever confirmed|0 |1 --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Huaqi from comment #2) > (In reply to Andrew Pinski from comment #1) > > Looks like an alias issue. > > Changing the matrix definitions to: > > extern float matA[], matB[], matC[]; > > > > > > Allows GCC to vectorize the loop even for x86_64. > > Yes, it works. But when I changed the function name to void * > CalculaProdutoMatriz(float *matA, float *matB, float *matC, void *arg), then > it still not work, I expected it may work, since I think it just similiar to > what you suggested. If you add restrict the arguments, GCC will also vectorizer. Again this is an aliasing issue.