encyclopegia.org

Dead code

The term dead code has multiple definitions. Some use the term to refer to code (i.e. instructions in memory) which can never be executed at run-time. In some areas of computer programming, dead code is a section in the source code of a program which is executed but whose result is never used in any other computation. The execution of dead code wastes computation time and memory. While the result of a dead computation may never be used, it may raise exceptions or affect some global state, thus removal of such code may change the output of the program and introduce unintended bugs. Compiler optimizations are typically conservative in their approach to dead-code removal if there is any ambiguity as to whether removal of the dead code will affect the program output. The programmer may aid the compiler in this matter by making additional use of static and/or inline functions and enabling the use of link-time optimization.

The term dead code has multiple definitions. Some use the term to refer to code (i.e. instructions in memory) which can never be executed at run-time. In some areas of computer programming, dead code is a section in the source code of a program which is executed but whose result is never used in any other computation. The execution of dead code wastes computation time and memory. While the result of a dead computation may never be used, it may raise exceptions or affect some global state, thus removal of such code may change the output of the program and introduce unintended bugs. Compiler optimizations are typically conservative in their approach to dead-code removal if there is any ambiguity as to whether removal of the dead code will affect the program output. The programmer may aid the compiler in this matter by making additional use of static and/or inline functions and enabling the use of link-time optimization. int foo(int x, int y) { int z = x / y; return x * y; } In the C code above example, although the division of x by y is computed and never used, it will raise a (floating point exception signal) when a division-by-zero occurs. Therefore, the removal of the dead code may change the output of the program.

References

  1. Hongwei Xi, Dead Code Elimination through Dependent Types · retrieved 2020-05-05 · rev 1325383945
    Cite this reference

    MLA "Hongwei Xi, Dead Code Elimination through Dependent Types." "Hongwei Xi, Dead Code Elimination through Dependent Types" (PDF). 2020-05-05. https://web.archive.org/web/20120310002543/http://www.cs.bu.edu/~hwxi/academic/papers/padl99.pdf. Accessed 24 November 2026.

    Chicago "Hongwei Xi, Dead Code Elimination through Dependent Types." "Hongwei Xi, Dead Code Elimination through Dependent Types" (PDF). 2020-05-05. https://web.archive.org/web/20120310002543/http://www.cs.bu.edu/~hwxi/academic/papers/padl99.pdf.

    APA "Hongwei Xi, Dead Code Elimination through Dependent Types" (PDF). (2020). Hongwei Xi, Dead Code Elimination through Dependent Types. Retrieved November 24, 2026, from https://web.archive.org/web/20120310002543/http://www.cs.bu.edu/~hwxi/academic/papers/padl99.pdf

  2. [1] Archived 2020-05-20 at the Wayback Machine DO-178B Wikipedia revision 1325383945, retrieved 2026-11-21 · retrieved 2026-11-20 · rev 1325383945
    Cite this reference

    MLA "[1] Archived 2020-05-20 at the Wayback Machine DO-178B Wikipedia revision 1325383945, retrieved 2026-11-21." Archived 2020-05-20 at the Wayback Machine DO-178B Wikipedia revision 1325383945, retrieved 2026-11-21. 2026-11-20. http://www.do178site.com/do178b_questions.php. Accessed 24 November 2026.

    Chicago "[1] Archived 2020-05-20 at the Wayback Machine DO-178B Wikipedia revision 1325383945, retrieved 2026-11-21." Archived 2020-05-20 at the Wayback Machine DO-178B Wikipedia revision 1325383945, retrieved 2026-11-21. 2026-11-20. http://www.do178site.com/do178b_questions.php.

    APA Archived 2020-05-20 at the Wayback Machine DO-178B Wikipedia revision 1325383945, retrieved 2026-11-21. (2026). [1] Archived 2020-05-20 at the Wayback Machine DO-178B Wikipedia revision 1325383945, retrieved 2026-11-21. Retrieved November 24, 2026, from http://www.do178site.com/do178b_questions.php

  3. DO-178B Wikipedia/DO-178B. Wikipedia revision 1325383945, retrieved 2026-11-21 · retrieved 2026-11-20 · rev 1325383945
    Cite this reference

    MLA "DO-178B Wikipedia/DO-178B. Wikipedia revision 1325383945, retrieved 2026-11-21." DO-178B Wikipedia/DO-178B. 2026-11-20. https://en.wikipedia.org/wiki/DO-178B. Accessed 24 November 2026.

    Chicago "DO-178B Wikipedia/DO-178B. Wikipedia revision 1325383945, retrieved 2026-11-21." DO-178B Wikipedia/DO-178B. 2026-11-20. https://en.wikipedia.org/wiki/DO-178B.

    APA DO-178B Wikipedia/DO-178B. (2026). DO-178B Wikipedia/DO-178B. Wikipedia revision 1325383945, retrieved 2026-11-21. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/DO-178B

  4. Debray, S. K., Evans, W., Muth, R., and De Sutter, B. 2000. Compiler techniques for code compaction. ACM Trans. Program. Lang. Syst. 22, 2 (Mar. 2000), 378–415. Wikipedia revision 1325383945, retrieved 2026-11-21 · retrieved 2026-11-20 · rev 1325383945
    Cite this reference

    MLA "Debray, S. K., Evans, W., Muth, R., and De Sutter, B. 2000. Compiler techniques for code compaction. ACM Trans. Program. Lang. Syst. 22, 2 (Mar. 2000), 378–415. Wikipedia revision 1325383945, retrieved 2026-11-21." Debray, S. 2026-11-20. http://doi.acm.org/10.1145/349214.349233. Accessed 24 November 2026.

    Chicago "Debray, S. K., Evans, W., Muth, R., and De Sutter, B. 2000. Compiler techniques for code compaction. ACM Trans. Program. Lang. Syst. 22, 2 (Mar. 2000), 378–415. Wikipedia revision 1325383945, retrieved 2026-11-21." Debray, S. 2026-11-20. http://doi.acm.org/10.1145/349214.349233.

    APA Debray, S. (2026). Debray, S. K., Evans, W., Muth, R., and De Sutter, B. 2000. Compiler techniques for code compaction. ACM Trans. Program. Lang. Syst. 22, 2 (Mar. 2000), 378–415. Wikipedia revision 1325383945, retrieved 2026-11-21. Retrieved November 24, 2026, from http://doi.acm.org/10.1145/349214.349233

  5. Appel, A. W. 1998 Modern Compiler Implementation in Java. Cambridge University Press. Wikipedia revision 1325383945, retrieved 2026-11-21 · retrieved 2026-11-20 · rev 1325383945
    Cite this reference

    MLA "Appel, A. W. 1998 Modern Compiler Implementation in Java. Cambridge University Press. Wikipedia revision 1325383945, retrieved 2026-11-21." Appel, A. 2026-11-20. https://en.wikipedia.org/wiki/Andrew_Appel. Accessed 24 November 2026.

    Chicago "Appel, A. W. 1998 Modern Compiler Implementation in Java. Cambridge University Press. Wikipedia revision 1325383945, retrieved 2026-11-21." Appel, A. 2026-11-20. https://en.wikipedia.org/wiki/Andrew_Appel.

    APA Appel, A. (2026). Appel, A. W. 1998 Modern Compiler Implementation in Java. Cambridge University Press. Wikipedia revision 1325383945, retrieved 2026-11-21. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Andrew_Appel

  6. Douglas W. Jones Dead Code Maintenance, Risks 8.19 (Feb. 1, 1989) Archived 2011-07-08 at the Wayback Machine Wikipedia revision 1325383945, retrieved 2026-11-21 · retrieved 2026-11-20 · rev 1325383945
    Cite this reference

    MLA "Douglas W. Jones Dead Code Maintenance, Risks 8.19 (Feb. 1, 1989) Archived 2011-07-08 at the Wayback Machine Wikipedia revision 1325383945, retrieved 2026-11-21." Douglas W. 2026-11-20. https://en.wikipedia.org/wiki/Douglas_W._Jones. Accessed 24 November 2026.

    Chicago "Douglas W. Jones Dead Code Maintenance, Risks 8.19 (Feb. 1, 1989) Archived 2011-07-08 at the Wayback Machine Wikipedia revision 1325383945, retrieved 2026-11-21." Douglas W. 2026-11-20. https://en.wikipedia.org/wiki/Douglas_W._Jones.

    APA Douglas W. (2026). Douglas W. Jones Dead Code Maintenance, Risks 8.19 (Feb. 1, 1989) Archived 2011-07-08 at the Wayback Machine Wikipedia revision 1325383945, retrieved 2026-11-21. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Douglas_W._Jones

  7. Habib Heydarian, Microsoft Corp Wikipedia revision 1325383945, retrieved 2026-11-21 · retrieved 2026-11-20 · rev 1325383945
    Cite this reference

    MLA "Habib Heydarian, Microsoft Corp Wikipedia revision 1325383945, retrieved 2026-11-21." 2026-11-20. http://blogs.msdn.com/b/habibh/archive/2009/07/31/discover-dead-code-in-your-application-using-code-analysis.aspx. Accessed 24 November 2026.

    Chicago "Habib Heydarian, Microsoft Corp Wikipedia revision 1325383945, retrieved 2026-11-21." 2026-11-20. http://blogs.msdn.com/b/habibh/archive/2009/07/31/discover-dead-code-in-your-application-using-code-analysis.aspx.

    APA encyclopegia.org. (2026). Habib Heydarian, Microsoft Corp Wikipedia revision 1325383945, retrieved 2026-11-21. Retrieved November 24, 2026, from http://blogs.msdn.com/b/habibh/archive/2009/07/31/discover-dead-code-in-your-application-using-code-analysis.aspx

  8. Eclipse Developer Guide Wikipedia revision 1325383945, retrieved 2026-11-21 · retrieved 2026-11-20 · rev 1325383945
    Cite this reference

    MLA "Eclipse Developer Guide Wikipedia revision 1325383945, retrieved 2026-11-21." 2026-11-20. http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm. Accessed 24 November 2026.

    Chicago "Eclipse Developer Guide Wikipedia revision 1325383945, retrieved 2026-11-21." 2026-11-20. http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm.

    APA encyclopegia.org. (2026). Eclipse Developer Guide Wikipedia revision 1325383945, retrieved 2026-11-21. Retrieved November 24, 2026, from http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm

  9. Hongwei Xi, Dead Code Elimination through Dependent Types . · retrieved 2025-12-01 · rev 1325383945
    Cite this reference

    MLA "Hongwei Xi, Dead Code Elimination through Dependent Types ." 2025-12-01. https://en.wikipedia.org/w/index.php?oldid=1325383945. Accessed 24 November 2026.

    Chicago "Hongwei Xi, Dead Code Elimination through Dependent Types ." 2025-12-01. https://en.wikipedia.org/w/index.php?oldid=1325383945.

    APA encyclopegia.org. (2025). Hongwei Xi, Dead Code Elimination through Dependent Types . Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1325383945

  10. [http://www.do178site.com/do178b_questions.php] Webarchive|url=https://web.archive.org/web/20200520200130/http://www.do178site.com/do178b_questions.php |date=2020-05-20 DO-178B . · retrieved 2025-12-01 · rev 1325383945
    Cite this reference

    MLA "[http://www.do178site.com/do178b_questions.php] Webarchive|url=https://web.archive.org/web/20200520200130/http://www.do178site.com/do178b_questions.php |date=2020-05-20 DO-178B ." http://www. 2025-12-01. https://en.wikipedia.org/w/index.php?oldid=1325383945. Accessed 24 November 2026.

    Chicago "[http://www.do178site.com/do178b_questions.php] Webarchive|url=https://web.archive.org/web/20200520200130/http://www.do178site.com/do178b_questions.php |date=2020-05-20 DO-178B ." http://www. 2025-12-01. https://en.wikipedia.org/w/index.php?oldid=1325383945.

    APA http://www. (2025). [http://www.do178site.com/do178b_questions.php] Webarchive|url=https://web.archive.org/web/20200520200130/http://www.do178site.com/do178b_questions.php |date=2020-05-20 DO-178B . Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1325383945

  11. [http://doi.acm.org/10.1145/349214.349233 Debray, S. K., Evans, W., Muth, R., and De Sutter, B. 2000. Compiler techniques for code compaction. ACM Trans. Program. Lang. Syst. 22, 2 (Mar. 2000), 378–41 . · retrieved 2025-12-01 · rev 1325383945
    Cite this reference

    MLA "[http://doi.acm.org/10.1145/349214.349233 Debray, S. K., Evans, W., Muth, R., and De Sutter, B. 2000. Compiler techniques for code compaction. ACM Trans. Program. Lang. Syst. 22, 2 (Mar. 2000), 378–41 ." http://doi. 2025-12-01. https://en.wikipedia.org/w/index.php?oldid=1325383945. Accessed 24 November 2026.

    Chicago "[http://doi.acm.org/10.1145/349214.349233 Debray, S. K., Evans, W., Muth, R., and De Sutter, B. 2000. Compiler techniques for code compaction. ACM Trans. Program. Lang. Syst. 22, 2 (Mar. 2000), 378–41 ." http://doi. 2025-12-01. https://en.wikipedia.org/w/index.php?oldid=1325383945.

    APA http://doi. (2025). [http://doi.acm.org/10.1145/349214.349233 Debray, S. K., Evans, W., Muth, R., and De Sutter, B. 2000. Compiler techniques for code compaction. ACM Trans. Program. Lang. Syst. 22, 2 (Mar. 2000), 378–41 . Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1325383945

  12. Douglas W. Jones [http://catless.com/Risks/8.19.html#subj2 Dead Code Maintenance, Risks 8.19 (Feb. 1, 1989)] Webarchive|url=https://web.archive.org/web/20110708124114/http://catless.com/Risks/8 . · retrieved 2025-12-01 · rev 1325383945
    Cite this reference

    MLA "Douglas W. Jones [http://catless.com/Risks/8.19.html#subj2 Dead Code Maintenance, Risks 8.19 (Feb. 1, 1989)] Webarchive|url=https://web.archive.org/web/20110708124114/http://catless.com/Risks/8 ." Douglas W. 2025-12-01. https://en.wikipedia.org/w/index.php?oldid=1325383945. Accessed 24 November 2026.

    Chicago "Douglas W. Jones [http://catless.com/Risks/8.19.html#subj2 Dead Code Maintenance, Risks 8.19 (Feb. 1, 1989)] Webarchive|url=https://web.archive.org/web/20110708124114/http://catless.com/Risks/8 ." Douglas W. 2025-12-01. https://en.wikipedia.org/w/index.php?oldid=1325383945.

    APA Douglas W. (2025). Douglas W. Jones [http://catless.com/Risks/8.19.html#subj2 Dead Code Maintenance, Risks 8.19 (Feb. 1, 1989)] Webarchive|url=https://web.archive.org/web/20110708124114/http://catless.com/Risks/8 . Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1325383945

  13. [http://blogs.msdn.com/b/habibh/archive/2009/07/31/discover-dead-code-in-your-application-using-code-analysis.aspx Habib Heydarian, Microsoft Corp] . · retrieved 2025-12-01 · rev 1325383945
    Cite this reference

    MLA "[http://blogs.msdn.com/b/habibh/archive/2009/07/31/discover-dead-code-in-your-application-using-code-analysis.aspx Habib Heydarian, Microsoft Corp] ." http://blogs. 2025-12-01. https://en.wikipedia.org/w/index.php?oldid=1325383945. Accessed 24 November 2026.

    Chicago "[http://blogs.msdn.com/b/habibh/archive/2009/07/31/discover-dead-code-in-your-application-using-code-analysis.aspx Habib Heydarian, Microsoft Corp] ." http://blogs. 2025-12-01. https://en.wikipedia.org/w/index.php?oldid=1325383945.

    APA http://blogs. (2025). [http://blogs.msdn.com/b/habibh/archive/2009/07/31/discover-dead-code-in-your-application-using-code-analysis.aspx Habib Heydarian, Microsoft Corp] . Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1325383945

  14. [http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm Eclipse Developer Guide] . · retrieved 2025-12-01 · rev 1325383945
    Cite this reference

    MLA "[http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm Eclipse Developer Guide] ." http://help. 2025-12-01. https://en.wikipedia.org/w/index.php?oldid=1325383945. Accessed 24 November 2026.

    Chicago "[http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm Eclipse Developer Guide] ." http://help. 2025-12-01. https://en.wikipedia.org/w/index.php?oldid=1325383945.

    APA http://help. (2025). [http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm Eclipse Developer Guide] . Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1325383945

Cite this article

MLA

"Dead code." encyclopegia.org, 2025, https://encyclopegia.org/wiki/dead-code. Accessed 24 November 2026.

Chicago

"Dead code." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/dead-code.

APA

encyclopegia.org. (2025). Dead code. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/dead-code

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Lexical analysis

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1325383945 · 0.5 · snapshot enwiki-001325383945

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.