http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48377
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
CC| |irar at gcc dot gnu.org
Resolution|INVALID |
Summary|[4.6 regression] |[4.6/4.7 regression]
|miscompilation at -O3 |miscompilation at -O3
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-07
07:44:18 UTC ---
I'd say that is a vectorization bug then. Either it shouldn't vectorize it at
all, or needs to ensure unaligned vector loads (resp. stores) are used
everywhere.
Short testcase:
typedef unsigned int U __attribute__((__aligned__ (1), __may_alias__));
__attribute__((noinline, noclone)) unsigned int
foo (const char *s, int len)
{
const U *p = (const U *) s;
unsigned int f = len / sizeof (unsigned int), hash = len, i;
for (i = 0; i < f; ++i)
hash += *p++;
return hash;
}
char buf[64] __attribute__((aligned (32)));
int
main (void)
{
return foo (buf + 1, 26);
}