GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
tree-optimization

Avoid fixing up removed statements during DOM cleanup

Ensures that statements removed during EH cleanup are not processed further during DOM cleanup.

This commit prevents the dominator pass from attempting to fix up statements that have already been removed as part of exception handling (EH) cleanup. By adding a check to ensure a statement still exists in the intermediate language (IL) before processing it, the compiler avoids potential errors and ensures the integrity of the control flow graph during dominator analysis. A new test case is provided for verification.

In Details

In tree-ssa-dom.cc, this commit modifies pass_dominator::execute to guard against operating on statements that have been previously removed during EH cleanup. Specifically, it adds a check to verify if a stmt is still present in the IL before calling fixup_noreturn_call. This addresses PR tree-optimization/128172, ensuring that the dominator tree construction remains sound even when EH-related statement removals occur.

Filed Under: optimizationexception handling