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

Joel Yliluoma <bisqwit at iki dot fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bisqwit at iki dot fi

--- Comment #2 from Joel Yliluoma <bisqwit at iki dot fi> ---
The theory that it is related to RVO seems to be confirmed by the fact that if
the code is changed like this:

   struct Vec { float v[8]; };
   void multiply(struct Vec* result,
                 const struct Vec* __restrict__ v1,
                 const struct Vec* __restrict__ v2)
   {
       for(unsigned i = 0; i < 8; ++i)
           result->v[i] = v1->v[i] * v2->v[i];
   }

Then it gets compiled in the shorter and proper form. Interestingly, even if
the __restrict__ attribute is removed, it still gets vectorized. Is this
correct behavior?

Reply via email to