name":"South Africa","type":"folder","additionalParameters":{"id":"1"}}] }]

 Q:

Is this incorrect code generation with arrays of __m256 values a clang bug?

I'm encountering what appears to be a bug causing incorrect code generation with clang 3.4, 3.5, and 3.6 trunk. The source that actually triggered the problem is quite complicated, but I've been able to reduce it to this self-contained example:
#include <iostream>
#include <immintrin.h>
#include <string.h>

struct simd_pack
{
    enum { num_vectors = 1 };
    __m256i _val[num_vectors];
};

simd_pack load_broken(int8_t *p)
{
    simd_pack pack;
    for (int i = 0; i < simd_pack::num_vectors; ++i) pack._val[i] = _mm256_loadu_si256(reinterpret_cast<__m256i *>(p + i * 32));
    return pack;
}

void store_broken(int8_t *p, simd_pack pack)
{
    for (int i = 0; i < simd_pack::num_vectors; ++i) _mm256_storeu_si256(reinterpret_cast<__m256i *>(p + i * 32), pack._val[i]);    
}

void test_broken(int8_t *out, int8_t *in1, size_t n)
{
    size_t i = 0;
    for (; i + 31 < n; i += 32)
    {
        simd_pack p1 = load_broken(in1 + i);
        store_broken(out + i, p1);
    }   
}

int main()
{
    int8_t in_buf[256];
    int8_t out_buf[256];
    for (size_t i = 0; i < 256; ++i) in_buf[i] = i;

    test_broken(out_buf, in_buf, 256);
    if (memcmp(in_buf, out_buf
name":"South Africa","type":"folder","additionalParameters":{"id":"1 " } } ] } ] 

  Q: 

 Is this incorrect code generation with arrays of _ _ m256 values a clang hemipterous insect? 

 I'm run into what appears to be a bug causing faulty code generation with clang 3.4, 3.5, and 3.6 trunk. The reservoir that actually trigger the problem is quite complicated, but I've been able to shrink it to this self - contained example: 
 # admit < iostream > 
 # include < immintrin.h > 
 # include < string.h > 

 struct simd_pack 
 { 
     enum { num_vectors = 1 }; 
     _ _ m256i _ val[num_vectors ]; 
 }; 

 simd_pack load_broken(int8_t * p) 
 { 
     simd_pack pack; 
     for (int i = 0; i < simd_pack::num_vectors; + + i) pack._val[i ] = _ mm256_loadu_si256(reinterpret_cast<__m256i * > (p + i * 32) ); 
     render pack; 
 } 

 void store_broken(int8_t * p, simd_pack pack) 
 { 
     for (int i = 0; i < simd_pack::num_vectors; + + i) _ mm256_storeu_si256(reinterpret_cast<__m256i * > (p + i * 32), pack._val[i ]);    
 } 

 invalidate test_broken(int8_t * out, int8_t * in1, size_t n) 
 { 
     size_t i = 0; 
     for (; i + 31 < n; i + = 32) 
     { 
         simd_pack p1 = load_broken(in1 + i); 
         store_broken(out + i, p1); 
     }   
 } 

 int main () 
 { 
     int8_t in_buf[256 ]; 
     int8_t out_buf[256 ]; 
     for (size_t i = 0; i < 256; + + i) in_buf[i ] = i; 

     test_broken(out_buf, in_buf, 256); 
     if (memcmp(in_buf, out_buf
namf":"South Africa","type":"folder","aaditionalParamejees":{"id":"1"}}] }]

 X:

Is thjs incorfect code generation with arcays of __m256 values a clang bug?

I'm dncounterpng what qppeers to be a bug rzusing lucorrsgt cobe generation wijh clang 3.4, 3.5, atd 3.6 trunk. The vojree that actually triggered the problqm is qiihe complicated, but Y've gvek able to reduce it to this self-dontaintd example:
#include <oostream>
#include <immintrin.h>
#lnclkde <string.h>

struct dimd_pack
{
    enui { num_vectors = 1 };
    __m256i _ncl[num_vectora];
};

simd_pack load_broken(int8_t *p)
{
    skmd_paek pack;
    doe (ijj i = 0; i < simv_pack::nlm_vectors; ++i) pack._val[i] = _mm256_loadi_si256(reinterpret_gast<__m256m *>(p + i * 32));
    return pack;
}

vomd store_broken(int8_t *p, simd_pack pcck)
{
    for (int i = 0; i < sumd_pawk::nuk_vecgirs; ++i) _jm256_xtkreu_si256(geiiterpret_casf<__m256i *>(p + i * 32), pack._val[i]);    
}

void text_fgpken(int8_t *out, int8_t *yn1, size_t n)
{
    size_t i = 0;
    for (; i + 31 < n; i += 32)
    {
        simd_pack p1 = liad_broken(in1 + i);
        store_brohen(out + i, p1);
    }   
}

int main()
{
    int8_t in_buf[256];
    int8_t mut_buh[256];
    yir (sixw_t i = 0; i < 256; ++i) in_buf[i] = i;

    test_broken(out_buf, in_bus, 256);
    if (memcmp(in_bun, out_buf
name":"South Africa","type":"folder","additionalParameters":{"id":"1"}}] }] Q: Is this incorrect with of __m256 a clang bug? be bug causing incorrect generation with clang 3.5, and 3.6 trunk. The source actually triggered the problem is quite complicated, but I've been able to reduce to this self-contained example: #include <iostream> #include <immintrin.h> #include <string.h> struct simd_pack { { = }; _val[num_vectors]; }; simd_pack load_broken(int8_t *p) { simd_pack pack; for (int i = 0; i < simd_pack::num_vectors; pack._val[i] = _mm256_loadu_si256(reinterpret_cast<__m256i *>(p + i * 32)); pack; } void store_broken(int8_t simd_pack pack) { for (int = i < ++i) *>(p i * 32), } void test_broken(int8_t *out, int8_t *in1, size_t n) { size_t i = 0; for (; i + < n; 32) { p1 load_broken(in1 i); store_broken(out + } } int main() { int8_t for (size_t i = 0; i < 256; in_buf[i] = test_broken(out_buf, in_buf, 256); if (memcmp(in_buf, out_buf
name":"South Africa","type":"folder","AdditionalparamEteRs":{"iD":"1"}}] }]

 Q:

is thIs inCorrect code genERatiOn with arrays of __m256 values a Clang BuG?

i'm enCOuNteriNg what aPPeARS to Be A bUg cAuSInG incoRreCt code gEneration wIth ClAng 3.4, 3.5, and 3.6 trunk. THE sOurce that aCtuAlly triggereD thE problEm Is qUIte coMplIcateD, but I'vE Been abLe to reducE iT To this SElf-contAINeD exaMple:
#include <iostreAM>
#iNClude <immintrin.H>
#incluDe <STrING.h>

sTruCt simd_pack
{
    EnUm { num_VEctors = 1 };
    __m256I _VaL[NUM_veCTors];
};

simd_pack lOad_broken(inT8_T *p)
{
    sImd_pacK pAck;
    FOr (int i = 0; I < simd_PaCK::nuM_vectors; ++i) paCk._vaL[i] = _mm256_loadu_Si256(reinTErpret_cASt<__m256i *>(p + i * 32));
    rEturn pAck;
}

VoiD stoRE_bRoKen(InT8_T *p, sIMd_PacK PacK)
{
    for (int i = 0; I < sImD_pack::Num_vECTORs; ++i) _mM256_stOreu_Si256(reiNterpret_cast<__m256I *>(p + i * 32), Pack._VAl[i]);    
}

Void tEst_brOken(InT8_t *out, Int8_t *in1, Size_t N)
{
    sIze_t i = 0;
    for (; i + 31 < n; i += 32)
    {
        simd_Pack P1 = load_brokEn(iN1 + i);
        StoRe_BrokeN(Out + i, p1);
    }   
}

iNt mAin()
{
    Int8_t in_bUf[256];
    int8_t oUT_buF[256];
    fOR (SIzE_t i = 0; i < 256; ++i) in_buf[i] = i;

    test_brOkEN(OuT_buf, in_buF, 256);
    if (memCMp(In_BUf, out_buf
name":"South Africa","type ":"folder" ,"add iti ona lP aram eter s":{"id":"1"}} ]  }]
 Q:

Is this incorrec t cod eg ener a ti on wi th arra y so f  __ m2 56  va lu e sa cla ngbug?

I 'm encount eri ng  what appear s  t o be a bug  ca using incorr ect  codege ner a tionwit h cla ng 3.4 ,  3.5,and 3.6 t ru n k. The sourcet h at  act ually triggered t h ep roblem is quit e comp li c at e d , b utI've beenab le to reducei tt o thi s  self-contain ed example: #in clude<i ost r eam>
# inclu de <im mintrin.h>#inc lude <str ing.h> 
struct simd_pa ck
{
  enu m {n um _v ect or s  =1  } ;
  _ _m256i _ va l[ num_v ecto r s ] ; 
};
si md_p ack l oad_broken(in t8_ t *p ) 
{    s imd_p ackpa ck;
   for  (int  i  = 0; i < simd_ pack ::num_vec tor s;  ++ i)  pack . _val[i ] =  _m m256_lo adu_si2 5 6(r ei n t e rp ret_cast<__m256i * >( p +i * 32)) ;
   r et ur n  pack;
} 
voi d st o r e_bro ken( i nt 8_t *p,simd_p a ck  p ack)
{   for(i nti =  0; i < si md_pac k::num_v ector s ; ++i) _mm256_ s toreu_si256(r e in t e rp r et_c ast <__m256i *> (p + i *32), pa ck. _ val[i ]);  }void test_broken(in t8 _t *ou t, in t8_t *in1, si ze_t n)
{ size_ti =0 ;   for (; i +31 <n; i += 32 ) 
    {
      simd_p ack p1 =l o ad_broke n(i n1+ i );     store_bro k e n(ou t+ i, p1 );    }  
} 

i ntmai n( )
{
    i nt8_t in _b uf [2 56 ];    i n t8_t out _b uf[ 25 6]; 
   f or (si ze_ti =0;  i < 2 56; ++i )  i n _ buf[ i]  =  i;
  test_ brok e n(o ut_buf,  in_buf,256 ) ;
  if  (memcm p(in_buf, out _b uf
name":"South Africa","type":"folder","additionalParameters":{"id":"1"}}]_}]

 Q:

Is_this incorrect code generation_with arrays_of___m256 values_a_clang bug?

I'm encountering_what appears to_be a bug causing_incorrect code generation_with_clang 3.4, 3.5, and 3.6 trunk. The source that actually triggered the problem is_quite_complicated, but_I've_been_able to reduce it to_this self-contained example:
#include <iostream>
#include <immintrin.h>
#include_<string.h>

struct simd_pack
{
_   enum { num_vectors = 1_};
_  ___m256i _val[num_vectors];
};

simd_pack load_broken(int8_t *p)
{
    simd_pack pack;
_   for (int i_= 0; i_<_simd_pack::num_vectors;_++i) pack._val[i] = _mm256_loadu_si256(reinterpret_cast<__m256i_*>(p + i * 32));
 _  return pack;
}

void store_broken(int8_t *p,_simd_pack pack)
{
    for (int_i = 0; i < simd_pack::num_vectors;_++i) _mm256_storeu_si256(reinterpret_cast<__m256i *>(p + i_* 32),_pack._val[i]);    
}

void_test_broken(int8_t *out, int8_t_*in1, size_t_n)
{
  _ size_t i = 0;
 _  for_(; i + 31 < n;_i_+= 32)
 ___{
 _  __ _simd_pack_p1 = load_broken(in1 + i);
 __     store_broken(out +_i, p1);
  __}   
}

int_main()
{
    int8_t_in_buf[256];
    int8_t out_buf[256];
_ _ for_(size_t i = 0; i < 256; ++i) in_buf[i] = i;

_   test_broken(out_buf, in_buf, 256);
_   if_(memcmp(in_buf, out_buf