https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118175

--- Comment #2 from Huaqi <fanghuaqi at vip dot qq.com> ---
(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.

See https://godbolt.org/z/fEE5cMG9n

And when I changed to above code, clang for riscv generate better vector
instruction than before.

Thanks

Reply via email to