The following code is misscompiled on 32 bit machines using gcc-4.4.0,
gcc-4.3.3 and gcc-4.3.2 with the -msse switch
===========
typedef float v2sf __attribute__ ((vector_size (2 * sizeof(float))));
int main()
{
v2sf a = {1.0, 0.0};
v2sf b = {0.0, 1.0};
v2sf d;
d = a + b;
return 0;
}
=============
The program runs fine without the -msse switch but segfaults as soon as
compiled with -msse.
The reason for this is the use of the movaps instruction on a seemingly
unaligned chunk of memory.
As a note, the same program compiles fine, if doubles are used instead of
floats.
--
Summary: Segmentation fault caused by alignment error in sse code
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tux008 at googlemail dot com
GCC build triplet: i686-linux-gnu
GCC host triplet: i686-linux-gnu
GCC target triplet: i686-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40550