This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/36054] bad code generation with -ftree-vectorize
- From: "Joey dot ye at intel dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 May 2008 07:22:49 -0000
- Subject: [Bug tree-optimization/36054] bad code generation with -ftree-vectorize
- References: <bug-36054-12873@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #13 from Joey dot ye at intel dot com 2008-05-05 07:22 -------
It is helpful. Root cause is that memory allocated by new is only aligned to 8
bytes under i386. In your case, object Environment is allocated by new and its
constructor tried to use movdqa to initialize its members. Following small case
shows the problem:
/* Compile with option -m32 -msse2
Current behavior: runtime segment fault
*/
#include <stdio.h>
#include <emmintrin.h>
struct A {
public:
__m128i m;
void init() { m = _mm_setzero_si128(); }
};
int main()
{
A * a = new A;
printf("Address of A: %p\n", a);
a->init();
delete a;
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36054