This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/54977] example3 not vectorized


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]