[Speex-dev] SSE bug on Win32 with GCC 4.2.1
Jean-Marc Valin
jean-marc.valin at usherbrooke.ca
Mon Aug 20 16:23:42 PDT 2007
> I recently found a .. weird bug on Win32 SSE with GCC 4.2.1.
>
> In libspeex/cb_search_sse.h, the following union is used:
>
> union {
> float __a[4];
> __m128 __v;
> } __u;
>
> For some odd reason, this particular version of GCC will not 16-byte
> align the union. IE; the alignment requirement of __v isn't propagated.
> Changing it into this:
>
> union {
> float __a[4];
> __m128 __v;
> } __u __attribute__((aligned(16)));
>
> And it works again. This is definitely a GCC bug, but I thought I'd
> mention it here in case others have similar problems.
That's, euh... "interesting". Did you submit a bug report to the gcc
team? I guess I could add your code as a workaround (do you know what
version started supporting that attribute?) until it's fixed. I just
find it amazing how many bugs in gcc Speex has managed to trigger. I
believe this is at least the third one related to SSE (one in 3.4, one
in 4.1).
Jean-Marc
More information about the Speex-dev
mailing list