From: Marco Costalba Date: Sat, 30 Oct 2010 17:44:34 +0000 (+0100) Subject: Fix some icc's "statement is unreachable" warnings X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=49a6fee4fa993a4e7fadba7846dc4ee058c8723e Fix some icc's "statement is unreachable" warnings No functional change. Signed-off-by: Marco Costalba --- diff --git a/src/search.cpp b/src/search.cpp index f3b092d2..7feb28b1 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -968,6 +968,7 @@ namespace { Key posKey; Move ttMove, move, excludedMove, threatMove; Depth ext, newDepth; + ValueType vt; Value bestValue, value, oldAlpha; Value refinedValue, nullValue, futilityBase, futilityValueScaled; // Non-PV specific bool isCheck, singleEvasion, singularExtensionNode, moveIsCheck, captureOrPromotion, dangerous; @@ -987,7 +988,7 @@ namespace { threatMove = sp->threatMove; mateThreat = sp->mateThreat; goto split_point_start; - } + } else {} // Hack to fix icc's "statement is unreachable" warning // Step 1. Initialize node and poll. Polling can abort search ThreadsMgr.incrementNodeCounter(threadID); @@ -1394,37 +1395,38 @@ split_point_start: // At split points actual search starts from here threatMove, mateThreat, moveCount, &mp, PvNode); } - if (SpNode) - { - // Here we have the lock still grabbed - sp->slaves[threadID] = 0; - lock_release(&(sp->lock)); - return bestValue; - } - // Step 19. Check for mate and stalemate // All legal moves have been searched and if there are // no legal moves, it must be mate or stalemate. // If one move was excluded return fail low score. - if (!moveCount) + if (!SpNode && !moveCount) return excludedMove ? oldAlpha : isCheck ? value_mated_in(ply) : VALUE_DRAW; // Step 20. Update tables // If the search is not aborted, update the transposition table, // history counters, and killer moves. - if (AbortSearch || ThreadsMgr.thread_should_stop(threadID)) - return bestValue; + if (!SpNode && !AbortSearch && !ThreadsMgr.thread_should_stop(threadID)) + { + move = bestValue <= oldAlpha ? MOVE_NONE : ss->bestMove; + vt = bestValue <= oldAlpha ? VALUE_TYPE_UPPER + : bestValue >= beta ? VALUE_TYPE_LOWER : VALUE_TYPE_EXACT; - ValueType vt = (bestValue <= oldAlpha ? VALUE_TYPE_UPPER : bestValue >= beta ? VALUE_TYPE_LOWER : VALUE_TYPE_EXACT); - move = (bestValue <= oldAlpha ? MOVE_NONE : ss->bestMove); - TT.store(posKey, value_to_tt(bestValue, ply), vt, depth, move, ss->eval, ss->evalMargin); + TT.store(posKey, value_to_tt(bestValue, ply), vt, depth, move, ss->eval, ss->evalMargin); - // Update killers and history only for non capture moves that fails high - if ( bestValue >= beta - && !pos.move_is_capture_or_promotion(move)) - { + // Update killers and history only for non capture moves that fails high + if ( bestValue >= beta + && !pos.move_is_capture_or_promotion(move)) + { update_history(pos, move, depth, movesSearched, moveCount); update_killers(move, ss); + } + } + + if (SpNode) + { + // Here we have the lock still grabbed + sp->slaves[threadID] = 0; + lock_release(&(sp->lock)); } assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE);