[Bug tree-optimization/54977] example3 not vectorized

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Oct 19 09:10:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54977

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|                            |FIXED
   Target Milestone|---                         |4.8.0

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-19 09:10:02 UTC ---
That is due to the overaligned type.  For GCC 4.7 and above, just use
__builtin_assume_aligned instead to hint the compiler about alignment.
void
foo (int n, int * __restrict px, int * __restrict qx)
{
  int *__restrict p = __builtin_assume_aligned (px, 16);
  int *__restrict q = __builtin_assume_aligned (qx, 16);
  while (n--)
    *p++ = *q++;
}

BTW, GCC 4.8 turns the testcase into memcpy (and with *q++ + 1 or similar to
avoid the memcpy it is vectorized since PR54894).

I don't think we want to change anything here for gcc 4.7.



More information about the Gcc-bugs mailing list