https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96854
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Keywords| |needs-bisection Known to fail| |10.1.0, 10.2.0 Known to work| |11.0, 9.3.0 Ever confirmed|0 |1 Target Milestone|--- |10.3 Last reconfirmed| |2020-08-31 Target| |x86_64-*-* i?86-*-* Summary|avx vectorizer breaks |[10 Regression] avx |complex arithmetic |vectorizer breaks complex | |arithmetic CC| |rguenth at gcc dot gnu.org --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- #include <complex.h> double complex __attribute__((noipa)) foo(double complex acc, const double complex *x, const double complex* y, int N) { for (int c = 0; c < N; ++c) acc -= x[c] * y[c]; return acc; } int main(void) { static const double complex y[] = { 1, 2, }; static const double complex x[] = { 1, 3, }; double complex ref = foo(0, x, y, 2); // reference if (creal(ref) != -7.) __builtin_abort (); return 0; } Confirmed with GCC 10.2, it works on trunk and with GCC 9.3.0. It doesn't need any -march for me, just -Ofast -mavx is enough.