Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Help with Release/Debug

Author: Charles L. Williams

Date: 12:18:55 06/13/99

Go up one level in this thread


On June 13, 1999 at 13:00:35, James Robertson wrote:

>I have not compiled a debug version of my program in a long while, and while I
>was testing my program yesterday discovered the disturbing fact that, while my
>debug mode plays 1/2 the speed of the release mode, it plays better. In the past
>when I have had bugs like this it was because I was accidentally overwriting an
>array, and because of the mysterious way in which the compiler pads and adds
>stuff to the debug version, the bug is often masked. I did some serious
>debugging and found and fixed one bug, but two more are still eluding me and
>need a more debugging.
>
>My question is: could someone please provide me with some debug/release theory
>under MSVC and what the differences are? It might really help me discover where
>the other two bugs are.
>
>Thanks!
>James


Here's one thing you might try with your Release.  Try compiling without
optimizing it for speed, and see if that makes a difference with the playing.

I had a problem with my Release build using 5.0.  I found that my second rank
pawns would only move one space in release, while the Debug would move two.  It
was because I used a shift macro to move pieces between ranks.  This macro
shifted the bit representing the piece's location right or left 8 spaces.  I was
using two consecutive calls to this macro to move the pawn two squares.  In
Release, the compiler incorrectly "optimized" the two consecutive identical
calls.  I only mention this as an example of something that can go wrong with
this compiler.  There are bugs in it.

Chuck



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.