Search

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

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 612671
Opened: 10/11/2010 5:15:59 PM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
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.
Details (expand)

Visual Studio/Silverlight/Tooling version

Visual Studio 2010

What category (if any) best represents this feedback?

Reliability

Steps to reproduce

Build and run the code with 64-bit debug configuration.
You may have to run it a couple of times before you get the access violation.

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

Access violation.

Expected results

No access violation.
File Attachments
0 attachments
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)
Sign in to post a workaround.