Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Compiler bug (OT)

Author: Lex Loep

Date: 01:06:27 12/09/01

Go up one level in this thread


On December 08, 2001 at 10:44:54, Christophe Theron wrote:

>On December 08, 2001 at 04:16:46, Lex Loep wrote:
>
<<SNIP>>
>
>I have found this bug a while ago.
>
>I had a bit of code that exchanged the higher and lower bytes in a word. It was
>programmed in a single expression and the compiler generated wrong code for it
>when some optimizations were turned on.
>
>Downloading the latest service pack (SP5) did not solve the problem. 13 hours of
>download for nothing, I was happy as you can imagine.
>
>Splitting the code in two lines solved the problem.
>
>The common point between your code and mine is that we are both using a shift
>operation combined with an or operation.
>

In our case it was the ordering of the "if (P1==0) " line. We looked at
the assembly code and found it was using the wrong register to do the
P1==0 thing, in effect the compare turned into P2==0.
I think it is releated to byte size operations.

>This is a common thing in any C program, so I feel very uncomfortable with this
>compiler bug.
>
>

That was my main reason to post here.

Still the compiler is quite good, this is the first time we found a bug in
this version. The older 16 bit compilers where much worse.

Lex


>
>    Christophe



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.