GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/tree-optimization Performance Win

Thread backward paths ending in computed gotos.

Backward threader now supports computed gotos, improving optimization analysis.

The GCC backward threader can now analyze control flow paths that terminate in computed gotos. Previously, it only handled conditional or switch statements, but recent improvements in points-to information from the prange analysis make handling GIMPLE_GOTO straightforward. This enhances the accuracy of optimization passes that rely on control flow analysis.

In Details

The back_threader in tree-ssa-threadbackward.cc determines reachability and control flow. It previously only handled GIMPLE_COND and GIMPLE_SWITCH on exit edges. This change adds support for GIMPLE_GOTO by leveraging recent prange (points-to analysis) improvements, enabling it to correctly thread paths that end in computed jumps. Handling of abnormal PHI nodes remains a follow-up task.

For Context
Backward threader
A compiler analysis pass that traces control flow paths backward from a given point to determine reachability and identify code structures.
Computed goto
A control flow construct where the target of a jump is determined at runtime by the value of an expression, typically a pointer to a label.
GIMPLE
GCC's Internal Machine-independent Optimizer Representation, a three-address code form used for intermediate optimization passes.
Points-to analysis
A static analysis technique that determines which memory locations a pointer variable might refer to during program execution.
Filed Under: optimizationcontrol-flowcompiler-internals