http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55510
Bug #: 55510
Summary: -O3 -msse3 produces an SSE optimization that produces
a Segmentation Fault
Classification: Unclassified
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
Created attachment 28815
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28815
This code reproduces the bug.
If a 16 byte aligned array is stored in the heap. The SSE optimization for a
simple assignment loop causes a segmentation fault.
struct test
{
double vectora[16] __attribute__ ((aligned (16)));
} __attribute__ ((aligned (16)));
int main()
{
test* str = new test();
for (int i = 0; i < 16; i++)
{
str->vectora[i] = 1.0; // SIGSEGV Here
}
}
To reproduce compile with
g++ -O3 -msse3 bugcase.cpp -o bugcase
then run it should SIGSEGV.