dead code

(redirected from Unreachable code)
Also found in: Wikipedia.

dead code

[′ded ′kōd]
(computer science)
Statements in a computer program that are not executed, usually as the result of modification of a large program.
McGraw-Hill Dictionary of Scientific & Technical Terms, 6E, Copyright © 2003 by The McGraw-Hill Companies, Inc.

dead code

(programming)
(Or "infeasible path", "grunge") Any part of a program that can never be accessed because all calls to it have been removed, or because it is guarded by a control structure that provably must always transfer control somewhere else. The presence of dead code may reveal either logical errors due to alterations in the program or significant changes in the assumptions and environment of the program (see also software rot); a good compiler should report dead code so a maintainer can think about what it means. Sometimes it simply means that an *extremely* defensive programmer has inserted can't happen tests which really can't happen - yet.

Synonym grunge.
This article is provided by FOLDOC - Free Online Dictionary of Computing (foldoc.org)
Mentioned in ?
References in periodicals archive ?
Code * Incomplete source code, unused or unreachable code. * Incorporation of "buggy" reuse code and ineffective integration of commercial off-the-shelf (COTS) and government-furnished equipment (GFE) software.
One suggestion for the future work could be the extension to detect unreachable code and report it.
At link time, unreachable code arises primarily from the propagation of information across procedure boundaries.
Unreachable code analysis involves a straightforward depth-first traversal of the control flow graph, and is performed as soon as the control flow graph of the program has been computed.
The baseline for our measurements is code optimized by the compiler as discussed above, but with unreachable code and no-ops removed and profile-guided code layout--which can improve performance significantly, but is not carried out by either of the compilers we used for our experiments--carried out.
To obtain instruction counts, we first disassemble the executable files and discard unreachable code and no-op instructions.
The columns labeled "Unoptimized" refer to programs compiled at optimization level -00, where no optimization is carried out, and serve as a reference point to indicate how much code size reduction is realized using only optimizations carried out by the compiler, while the columns labeled "Base" refer to code optimized at the appropriate level, as discussed above, with unreachable code and no-ops removed.
(Recall that our baseline programs have already had unreachable code and no-ops removed.
The columns labeled "Original" refer to the execution times of the inputs optimized at the appropriate level for each compiler, as discussed earlier, but without the elimination of unreachable code and no-ops.
Other optimizations, in particular the elimination of unreachable code, have no effect on the number of instructions executed.