Internal compiler error: compiler stack overflow with bit shifting in a loop - by Nicholas J. H. Chapman

Status : 

 


1
0
Sign in
to vote
ID 3103386 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 9/17/2016 6:59:20 AM
Access Restriction Public

Description

The following c++ code:

uint32 bitTest(uint32 y, uint32 N)
{
	int shift = 1;
	for(uint32 i=0; i<N; ++i)
		shift = y >> (shift + 1);
	return shift;
}

gives

n:\indigo\trunk\utils\bitfield.cpp(21): fatal error C1063: compiler limit: compiler stack overflow

When compiled in VS2015 update 3, with optimisations enabled..
Sign in to post a comment.
Posted by Gratian [MSFT] on 9/22/2016 at 4:39 PM
Hi,

Thanks for reporting the bug, we received another report for this problem earlier and the bug has been fixed.
The fix will be available in a future micro-update and the next major Visual Studio release.
Until then, the best workaround is to disable the new optimizer introduced with Update 3 using the -d2SSAOptimizer- flag. More details here:
https://blogs.msdn.microsoft.com/vcblog/2016/05/04/new-code-optimizer/

Thanks,
Gratian Lup
Visual C++ Optimizer team
Posted by Microsoft on 9/20/2016 at 7:32 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If you require immediate assistance with this issue, please contact product support at http://support.microsoft.com/oas/default.aspx?prid=15825.
Posted by Microsoft on 9/20/2016 at 7:31 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If you require immediate assistance with this issue, please contact product support at http://support.microsoft.com/oas/default.aspx?prid=15825.