Home Dashboard Directory Help
Search

Incorrect code generation for __restrict keyword with full optimization by Ilya Grebnov


Status: 

Closed
 as Fixed Help for as Fixed


1
0
Sign in
to vote
Type: Bug
ID: 739798
Opened: 4/29/2012 8:57:07 PM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

Please compile and test attached C++ application for Debug and Release targets. Note, this sample app is simplified version my actual application. Application is cross platform and work well with GCC, Clang and Intel C++, but crashes when compiled with Visual Studio 2010.
Details
Sign in to post a comment.
Posted by Microsoft on 5/4/2012 at 8:02 AM
Hi, thanks for the bug report. The C++ compiler optimizer has struggled when a __restrict pointer is pointing to a local or global variable. I have fixed this for the VS11 release.

For what it's worth, __restrict gives the best performance benefits when you mark paramters to a function as being restrict (and to some extent, return values of functions). Setting, for example, int * __restrict p = &g; is a little weird. Regardless, I have fixed the bug in the optimizer -- we should not be generating bad code here.

You probably know this already, but if you need a workaround try removing __restrict.

Eric
Microsoft Visual C++
Posted by MS-Moderator07 [Feedback Moderator] on 4/30/2012 at 1:49 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 4/29/2012 at 9:43 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.