Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: MSVC .NET 2003 optimization bug [O.T]

Author: Dann Corbit

Date: 15:33:12 04/09/04

Go up one level in this thread


On April 09, 2004 at 18:04:10, Russell Reagan wrote:

>I'm posting this here because I know that some of the programmers here use MSVC
>.NET 2003, and in hopes that Eugene will read this :)
>
>Today I had a problem with a program I was writing, and I came across what I
>believe is an optimization bug. I wrote this little program to reproduce the
>bug. If I compile with optimizations set to "Disabled", there is no problem. If
>I compile with optimzations set to anything else (Maximize Speed, Minimize Size,
>Full Optimizations), the program crashes due to a loop never terminating. The
>source code is at the end of this message. The line where the problem occurs is:
>
>for (row = 11; row < 12; row--)
>
>The problem is the comparison: row < 12
>
>When optimizations are turned off, this is the assembly output for that
>comparison:
>
>cmp DWORD PTR _row$[ebp], 12
>
>If optimizations are turned on, this is the assembly output:
>
>cmp ebx, OFFSET FLAT:_a+576
>
>I'm no assembly expert, but that looks like it is comparing the address of two
>pointers to me, and has nothing to do with comparing two values.
>
>Here is the example C source code. I compiled it under GCC with and without
>optimizations and it ran fine. Another person with MSVC .NET 2003 ran this code
>and he reported the same problem of crashing with optimizations turned on.
>
>Is this really an optimization bug, or is it possible that I am doing something
>wrong with the compiler settings? If this is indeed an optimization bug, how can
>I find out if Microsoft is already aware of it? If they are not aware of it, how
>can I report it to them?

I posted a message here:

http://communities2.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.dotnet.languages.vc&cat=en-us-visualtoolsandlanguages-visualcplusplus&lang=en&cr=US

I think probably someone will find it and act on it.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.