GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc

Provide a DCE no-delete option.

GCC's Dead Code Elimination pass now offers a 'no-delete' option to replace dead statements with assignments to zero.

A new option has been added to GCC’s Dead Code Elimination (DCE) pass, allowing it to replace dead statements with assignments to zero instead of completely removing them. This change provides more control over the optimization process, particularly useful for debugging or specific analysis scenarios where the presence of zero assignments is informative.

In Details

The simple_dce_from_worklist function in tree-ssa-dce.cc has been extended with a no-delete parameter. When this option is enabled, instead of removing dead statements, they are replaced with assignments to zero. This is particularly useful for debugging DCE itself or for preserving certain code structures for analysis tools, as demonstrated by its use in tree-vrp.cc's remove_unreachable handler.

For Context
Dead Code Elimination (DCE)
A compiler optimization pass that removes code that does not affect the program's output or behavior.
SSA
Static Single Assignment form. An intermediate representation where every variable is assigned exactly once.
Value Range Propagation (VRP)
A compiler optimization pass that determines the possible range of values for variables and expressions.
Filed Under: compileroptimizationdebugging