BUG: Incorrect Code for Loop with Known ValueLast reviewed: November 2, 1995Article ID: Q122542 |
The information in this article applies to:
SYMPTOMSWhen you use the /Ox, /Og, /O1, or /02 optimizations with the 32-bit compiler or the /Ox and /Ol optimizations with the 16-bit compiler, incorrect code is generated for loops where the number of iterations is a known value. The loop is not executed.
RESOLUTIONWorkarounds are:
STATUSMicrosoft has confirmed this to be a bug in the products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Sample Code to Reproduce Problem
/* Compile options needed: /* 32-bit compiler: /Ox, /Og, /O1, or /02 /* 16-bit compiler: /Ox or /Ol */ /* This sample prints out 11 */ #include <stdio.h> void main(void){ int i = 500;loop: i++; if( i <= 10 ) goto loop; printf( "This should be 501: %d\n", i );}
|
Additional reference words: 1.00 1.50 1.51 2.00 7.00 8.00 8.00c 9.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |