GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
uncprop Performance Win

Uncprop: Optimize compile time by storing only switch case values.

The compiler now stores only the case value instead of the entire CASE_LABEL_EXPR for switch statements, improving compile time.

The compiler’s unconstrained propagation pass now stores only the value of switch case labels instead of the entire CASE_LABEL_EXPR. This reduces memory usage during compilation, which improves compile time. Comments were added to clarify the code.

In Details

During the conversion of gswitch away from CASE_LABEL_EXPR, associate_equivalences_with_edges in tree-ssa-uncprop.cc was found to be storing the entire CASE_LABEL_EXPR when only the case value is needed. This commit optimizes this by storing only the case's low value.

For Context

The unconstrained propagation pass in a compiler optimizes code by tracking and propagating the possible values of variables. Switch statements associate different code blocks with specific case values. This commit optimizes the representation of switch statements within the compiler, reducing memory usage and potentially improving compile times.

Filed Under: optimizationcompile timeswitch statement