------- Comment #19 from hjl dot tools at gmail dot com  2010-07-14 15:52 
-------
(In reply to comment #15)
> I found the similar case with gcc 4.4.4 of MacPorts and gcc 4.4.0 of MinGW.
> 
> -- begin testcase --
> // g++ -O -msse2 test.cpp
> typedef long long __m128i __attribute__ ((__vector_size__ (16),
> __may_alias__));
> 
> struct vec
> {
>         __m128i v;
> 
>         static vec load(const int * p)
>         { return (__m128i) __builtin_ia32_loaddqu((char const *)p); }
> 
>         const int & operator [](int i) const
>         {
>                 union u {
>                         __m128i v;
>                         int     e[4];
>                 };
> 
>                 return ((const u &)v).e[i];
>         }
> 
>         vec() {}
>         vec(const __m128i & a) : v(a) {}
> };
> 
> extern "C" {
>         int  printf (const char*, ...);
> }
> 
> int main( int argc, char * argv[] )
> {
>         __attribute__((aligned(16))) int data[] =
>         { 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5 };
> 
>         vec a = vec::load(data);
> 
>         printf("v: %d, %d, %d, %d\n", a[0], a[1], a[2], a[3]);
> 
>         return 0;
> }
> -- end testcase --
> 
> -- begin output --
> v: 16, 16, 14, 14
> -- end output --
> 

This is caused by revision 134947:

http://gcc.gnu.org/ml/gcc-cvs/2008-05/msg00107.html


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44900

Reply via email to