I don't think I could recall any bug which I encountered in the past which could be attributed to the gcc compliler. I don't believe much in compiler bugs. But I could not see any bug in the codes below.
Code: Select all
/* In root search; after generate root move list.
Initialize root moves list */
for (move = list; move->move; ++move) {
...
move->score = EVAL_SCORE_BASE;
...
makemove(move->move, side);
/* now move validated */
assert(move->score > EVAL_SCORE_BASE - INFI
&& move->score < EVAL_SCORE_BASE + INFI);/* assert clears */
if (currstack->fifty < 100) {
for (i = 4; i <= currstack->fifty; i += 2) {
if (currstack->hash ^ (currstack - i)->hash);
else { /* repetition */
move->flag |= rmFlagDraw;
move->eval = -INFI; // no eval
move->score = EXACT_SCORE_BASE; /* A == draw */
if (IS_MOVE_EQ(searchInfo->bestmove, move->move)) {
matesearch = 0;
if (searchInfo->score < -1) {
/* retain bestmove */
searchInfo->score = 1;
pBestmove = move;
} else {
searchInfo->bestmove = pv[0][0] = 0;
}
best = -INFI;
alpha = MAX(-INFI, searchInfo->score - v112Pawn);
beta = MIN(INFI, searchInfo->score + v112Pawn);
sendlog("!!! best score cancelled - draw\n");
}
i = 0;
unmake(move->move, side);
}
}
if (i == 0){
assert(0);
continue;
}
} else {
move->flag |= rmFlagDraw;
move->eval = -INFI;
move->score = EXACT_SCORE_BASE; // == draw
if (IS_MOVE_EQ(searchInfo->bestmove, move->move)) {
matesearch = 0;
if (searchInfo->score < -1) {
/* retain bestmove */
searchInfo->score = 1;
pBestmove = move;
} else {
searchInfo->bestmove = pv[0][0] = 0;
}
best = -INFI;
alpha = MAX(-INFI, searchInfo->score - v112Pawn);
beta = MIN(INFI, searchInfo->score + v112Pawn);
sendlog("!!! best score cancelled - draw\n");
}
unmake(move->move, side);
continue;
}
assert(move->score > EVAL_SCORE_BASE - INFI
&& move->score < EVAL_SCORE_BASE + INFI); /* B _fail */
1) currstack->fifty == 3.
2) move->score == EXACT_SCORE_BASE;
Only line that sets it is line A within the repetition loop.
Hopefully, I did not miss something glaringly obvious.
Best Regards,
Rasjid.