I'm using Apple GCC 4.2.1 and I've stumbled upon a strange problem with the following code... I always get EXC_BAD_ACCESS exception when trying to initialize __m128 class member variable. Unfortunately the following simplified code works in a test application, but maybe you can still help me locate the root of this problem?
I fail to understand the reason behind EXC_BAD_ACCESS exception - __m128 type is not a pointer and all other MyClass members are initialized and accessed without any problems, there are no signs of stack / heap corruption, everything works if I use local variables and there are no problems under MSVC... Maybe something is wrong with alignment?
Please help!
class MyClass
{
public:
// lots of members
__m128 vect;
MyClass()
{
vect = _mm_setr_ps (0.f, 0.f, 0.f, 10.0f); // Program received signal: “EXC_BAD_ACCESS”.
}
void iniialize()
{
__m128 localVector = _mm_setr_ps (0.f, 0.f, 0.f, 10.0f); // No problems
vect = localVector; // Program received signal: “EXC_BAD_ACCESS”.
}
};