[VC2010] Alignment issue with _mm256_store_si256() AVX intrinsic in 64-bit debug builds - by DaveB

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 612671 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 10/11/2010 5:15:59 PM
Access Restriction Public


The following repro runs without issue when compiled with ICC, but produces an Access Violation when compiled with VC2010 in 64-bit debug builds:

void AVXRepro( __m256i* d, const __m256i* s )
    // This will cause an occasional access violation when compiled with VC2010.  
    // It does not occur in 32-bit builds.  Nor does it occur if you remove the 
    // post-increment from the arguments.
    _mm256_store_si256( d++, *s++ );

int main()
    const size_t MaxElements = 2;
    __m256i v1[ MaxElements ], v2[ MaxElements ];

    for( int i = 0; i < _countof( v1 ); ++i )
        for( int j = 0; j < _countof( v1[0].m256i_u32 ); ++j )
            v1[i].m256i_u32[j] = i * _countof( v1[0].m256i_u32 ) + j;

    AVXRepro( v2, v1 );
    return 0;

Please note that the access violation doesn't necessarily occur on every run, so be sure to run it a few times (I only have to try it once or twice).  

Also, I'm running this on native AVX-enabled hardware running 64-bit Win7 SP1 beta.  When running it with through the Intel Software Development Emulator on non-AVX hardware (64-bit Win7 without SP1 beta), I get the following:

SDE ERROR: ALIGN32 FAILED PC=13f161421 MEMEA=18f4d0 vmovdqa ymmword ptr [rsp], ymm0 

Again, it sometimes takes a few runs to get it to trigger...and it doesn't ever occur when the repro is compiled with ICC.
Sign in to post a comment.
Posted by DaveB on 10/13/2010 at 10:56 AM
I'm currently working with the Intel guys that work with the VC++ team on this issue. The bug has been confirmed, and there is currently a fix in the works.
Posted by Microsoft on 10/12/2010 at 2:50 AM
Thank you for reporting this issue.
But we were not able to reproduce it with the steps you provided. Could you please attach a demo project and screenshots to help us investigate this issue?
Posted by Microsoft on 10/11/2010 at 5:23 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)