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

--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> ---
Nothing gets vectorized :-(
Note that to fill the vector, this would be better

  std::vector<double> array(size, 1e-9);

In the reduction, we seem to do strange things with the accumulator.

        addsd   (%rax), %xmm1
        addq    $8, %rax
        cmpq    %rbx, %rax
        movsd   %xmm1, (%rsp)
        jne     .L13

or

        vmovq   %rbp, %xmm2
        vaddsd  (%rax), %xmm2, %xmm1
        addq    $8, %rax
        vmovq   %xmm1, %rbp
        cmpq    %rbx, %rax
        jne     .L13

We aren't happy with xmm1, we save the value to memory in the first case, and
to an integer register in the second case where we even restore the value from
that register...

Reply via email to