GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
cobol Performance Win

cobol: Decrease middle-end processing time with better GENERIC.

Optimizes COBOL initialization by batching GENERIC nodes and using library calls.

This commit significantly improves the middle-end processing time for COBOL code, reducing it by factors of three to five. It achieves this by collecting variable initialization into table-driven library calls and by grouping GENERIC nodes into batches for more efficient processing. These changes streamline how COBOL variable initializations are handled, leading to faster compilation for COBOL programs.

In Details

Middle-end processing of COBOL variable initialization was identified as a performance bottleneck. This patch introduces two main optimizations: 1) Table-driven calls to a library routine (__gg__propagate_linkage_offsets) for initializing complex, hierarchical COBOL variables, replacing individual processing. 2) Batching of adjacent GENERIC nodes representing initializations, processing them as a group without reordering across executable statements. This reduces the number of GIMPLE statements and the associated processing overhead.

For Context
GENERIC
An intermediate representation in GCC, situated between the language-specific parse trees and GIMPLE. It's a lower-level, more abstract representation used for many optimizations.
GIMPLE
GCC's internal three-address code representation, used after parsing and before final machine code generation. It's a key intermediate language for optimizations.
middle-end
The part of a compiler that performs machine-independent optimizations on an intermediate representation of the code, before backend-specific code generation.
variable initialization
The process of assigning an initial value to a variable when it is declared or before it is first used.
Filed Under: coboloptimizationperformance