Search

Visual Studio 2012 RC compiler crashes with /Ox & /fp:fast options by Mārtiņš Možeiko

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 749567
Opened: 6/17/2012 12:58:44 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
Code below crashes cl.exe compiler:

#include <math.h>

void foo()
{
    float data[2 * 30];
    float angle = 0.0f;

    for (int i = 0; i < 30; i++)
    {
        float y = float (cos(angle));
        data[i] = y;
        data[i + 30] = y;
        angle += 42.0f;
    }
}
Details (expand)

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

Visual Studio 2012 RC

Steps to reproduce

Invoke from "VS2012 x86 Native Tools Command Prompt" code above with "cl.exe /Ox /fp:fast /c test.cpp"
Line 10 is line with call to cos() function.

Version of cl.exe = "Microsoft (R) C/C++ Optimizing Compiler Version 17.00.50522.1 for x86"

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

test.cpp
c:\dev\...\test.cpp(10) : fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 211)
To work around this problem, try simplifying or changing the program near the locations 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 11.0\VC\BIN\cl.exe'
    Please choose the Technical Support command on the Visual C++
    Help menu, or open the Technical Support help file for more information

Expected results

Compiler successfully produces test.obj file.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 6/26/2012 at 1:12 PM
Hey, I just wanted to let you know we have fixed this bug for the VS11 release.

Eric
Posted by Microsoft on 6/22/2012 at 7:11 PM
Hi, thanks for the bug report. We are working on a fix for the release of VS11 RTM.

If you need a workaround, please use #pragma optimize("", off) <the affected function> #pragma optimize("", on).

The crash is in the C++ compiler optimizer, and happens when we try to distribute one loop into multiple loops to split a data dependence.

Thanks,
Eric - Microsoft Visual C++
Posted by Microsoft on 6/17/2012 at 11:07 PM
Thank you for submitting feedback on Visual Studio 11 and .NET Framework. Your issue has been routed to the appropriate VS development team for review. We will contact you if we require any additional information.

Posted by Microsoft on 6/17/2012 at 1:55 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.