Search

Global variables of __m128i type behave incorrectly with global optimization. by Arseny Kapoulkine

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 615374
Opened: 10/20/2010 12:39:16 PM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
When using a global variable of __m128i type from several translation units (via extern), the size of the variable differs if global optimizations are enabled.
Details (expand)

Visual Studio/Silverlight/Tooling version

Visual Studio 2010

What category (if any) best represents this feedback?

Reliability

Steps to reproduce

1. Create file a.cpp with the following contents:

#include <emmintrin.h>

extern __m128i g_value;

int main()
{
    return g_value.m128i_i32[0];
}

2. Create file b.cpp with the following contents:

#include <emmintrin.h>

__m128i g_value;

3. Compile them together with the following options:

cl /GL a.cpp b.cpp

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

There is a compilation warning:

warning C4743: 'union __m128i g_value' has different size in 'E:\work\misc\bugs\m128i_bug\b.cpp' and 'E:\work\misc\bugs\m128i_bug\a.cpp': 18 and 16 bytes

Expected results

Code compiles without any warnings.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 11/22/2010 at 5:53 PM
Hi.

This warning is actually a false positive in your case. We plan to fix this issue in the next release of Visual Studio.

If you are currently blocked by this warning, you can add /wd4743 to the command line.
Posted by Microsoft on 10/21/2010 at 2:02 AM
Thank you for reporting the issue.
We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution.These specialized experts will follow-up with your issue.
Posted by Microsoft on 10/20/2010 at 6:35 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.