Search

C/C++ compiler crashes on simple code by Mārtiņš Možeiko

Closed
as Fixed Help for as Fixed

2
0
Sign in
to vote
Type: Bug
ID: 740143
Opened: 5/1/2012 11:47:10 PM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
0
Workaround(s)
1
User(s) can reproduce this bug
Compiler from Visual Studio 2010 SP1 crashes on following simple code when compiling with /O2

int main()
{
int x = 2;
    
    while (x != -1)
    {
        switch (x)
        {
            case 2:
            {
                x = -1;
                break;
            }
        }
    }
}
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling version

Visual Studio 2010 SP1

Steps to reproduce

Run "cl.exe /O2 main.c" where main.c file contains code above.

Or create new C++ project, copy & paste code above in place of main and try to compile in Release configuration.

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

cl.exe compiler crashes with message:

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

a.c
c:\folder\a.c(7) : fatal error C1001: An internal error has occurred in the compiler.

(compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c[0x500D38D3:0x00000008]'
, line 183)
To work around this problem, try simplifying or changing the program near the l
ocations listed above.
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Internal Compiler Error in c:\Program Files (x86)\Microsoft Visual Studio 10.0\V
C\BIN\cl.exe. You will be prompted to send an error report to Microsoft later.

Expected results

Compiler doesn't crash and generate correct executable.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 5/2/2012 at 5:06 PM
Thanks for taking the time to report this. I was able to reproduce the crash using VS2010 SP1. I can confirm that this issue has been fixed and the problem does not reproduce with the upcoming VS2012 release (Beta downloads now available).

thanks,
ian Bearman
Principal Developer
VC++ Code Generation & Optimization
Posted by MS-Moderator07 [Feedback Moderator] on 5/2/2012 at 2:06 AM
Thanks for your feedback.

We are rerouting 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 MS-Moderator01 on 5/2/2012 at 12:42 AM
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.