473,508 Members | 2,369 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Visual C++ 2003 optimization bug

This piece of code prints "Hello, World!" only once if optimizations are
enabled.
It is expected to print "Hello, World!" 2^32 times.

Optimizations: /O2
Compiler version: 13.10.3077 (VS.Net 2003)

= = = = = = = = =

#include <stdio.h>

void main(void)
{
unsigned i = 0;
do
{
printf ("Hello, World!\n");
++i;
}
while (i != 0);
}

= = = = = = = = =
Best regards,
Andrew Burlak.
Nov 17 '05 #1
2 1098
>This piece of code prints "Hello, World!" only once if optimizations are
enabled.
It is expected to print "Hello, World!" 2^32 times.


Andrew,

I can repro this incorrect optimization with VS2003, but it appears to
be resolved with the current Whidbey alpha compiler.

Merry Christmas
Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #2
David,
Thank you for reply.

I found that this bug was reported in VS.Net 2002:
http://groups.google.com/groups?hl=e...04%26rnum%3D10

It's good news that it is already fixed in Whidbey.

"David Lowndes" <da****@mvps.org> wrote in message
news:90********************************@4ax.com...
This piece of code prints "Hello, World!" only once if optimizations are
enabled.
It is expected to print "Hello, World!" 2^32 times.


Andrew,

I can repro this incorrect optimization with VS2003, but it appears to
be resolved with the current Whidbey alpha compiler.

Merry Christmas
Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6151
by: Martin Bless | last post by:
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME C++ compiler and linker Python is built with...
0
6075
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
5
3727
by: Anton Noll | last post by:
We are using Visual Studio 2003.NET (C++) for the development of our software in the fields digital signal processing and numerical acoustics. One of our programs was working correctly if we are...
5
2838
by: John Smith | last post by:
Sorry if this is the wrong forum... Does anyone know what the difference is between a debug build and an optimised debug build in Visual Studio 2003?
1
1011
by: Markus Neff | last post by:
Dear MS VS .NET 2003 users, so far I used MS VS 6.0 SP5 for a rather large C++ project. Now I want to migrate to MS VS .NET 2003. First tests however showed that compilation and most notably...
3
4422
by: Binary | last post by:
VC++ .NET 2003: Access violation with /O2 compiler switch; no AV with /O Hi I'm in the process of narrowing down a problem, and I have reduced the code involved to the following If someone could...
5
1434
by: Michael | last post by:
i experience slower compile times with VC++ 2003 compared to VC+6.0. Anyone experiencing the same? Should that be expected? This ineed matters, when total compilation time is > 1h and you have to...
4
1904
by: Pavel A. | last post by:
Hello, I'm having strange issues with inline functions in VS.2003. In following simple code snippet: extern int mytmp1( int v ) { return !v; }; extern int mytmp( void ) { return mytmp1( -7...
1
1009
by: Piggy | last post by:
using namespace std; class foobar { public: foobar() { cout << "foobar::foobar()\n"; } ~foobar() { cout << "foobar::~foobar()\n"; } foobar(int nval ):_ival(nval) { cout <<...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.