Alan Woodland <[EMAIL PROTECTED]> writes:

> My first thought was that I had some how done something wrong with the
> alignment

That appears to be correct guess.

> - I'm using template specialization to facilitate this, so I
> added the following asserts just before the offending code:
>
> assert(__alignof__(__m128) == __alignof__(this->data[0]));
> assert(__alignof__(__m128) == __alignof__(o.data[0]));

These assert()s aren't good. From "info gcc":

  If the operand of `__alignof__' is an lvalue rather than a type,
  its value is the required alignment for its type, taking into
  account any minimum alignment specified with GCC's `__attribute__'
  extension (*note Variable Attributes::).  For example, after
  this declaration:

     struct foo { int x; char y; } foo1;

  the value of `__alignof__ (foo1.y)' is 1, even though its actual
  alignment is probably 2 or 4, the same as `__alignof__ (int)'.

IOW, '__alignof__(this->data[0])' is 16 because that's what __m128
*should* be aligned on. But *actual* alignment of this->data[0] is 
8 (which isn't good enough):

> (gdb) print this->data
> $3 = (__m128 *) 0x8050978

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to