https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64410
--- Comment #8 from Marc Glisse <glisse at gcc dot gnu.org> --- (In reply to Richard Biener from comment #5) > (In reply to Marc Glisse from comment #1) > > There are a number of things that make it complicated. > > 1) gcc doesn't like to vectorize when the number of iterations is not known > > at compile time. > > Not an issue, we know it here (it's symbolic) IIRC I tried modifying the original code by replacing all complex operations by explicit scalar operations and it failed to vectorize, but worked when replacing the number of iterations by a constant. > > 3) the ABI for complex uses 2 separate double instead of a vector of 2 > > double. > > I think that's unrelated. Indeed, it's just that with a different ABI we could have been lucky and stumbled upon the optimal code, almost by accident.