This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/54977] example3 not vectorized
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 19 Oct 2012 09:10:02 +0000
- Subject: [Bug tree-optimization/54977] example3 not vectorized
- Auto-submitted: auto-generated
- References: <bug-54977-4@http.gcc.gnu.org/bugzilla/>
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.