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

cobol: Reduce middle-end time with better GENERIC representation

Optimizes COBOL compilation by consolidating library calls and passing parameters in structures.

This commit improves COBOL compilation performance by reducing middle-end processing time. It consolidates multiple calls to libgcobol into a single call and passes parameters in a structure, rather than individually. Additionally, it fixes the behavior of -fstatic-call and -fno-static-call options and moves a warning message to runtime.

In Details

Compilation time for COBOL's -fno-static-call is reduced by consolidating libgcobol calls within genapi.cc's function_pointer_for_literal_call and parser_call. Parameters for library calls are now passed via a structure. The cobol1.cc and genapi.cc functions use_static_call were renamed to set_use_static_call, and cobol_langhook_handle_option now uses the value parameter. A warning message is moved from compile-time to libgcobol.cc.

For Context
GENERIC
An intermediate representation in GCC that is language-independent and serves as a precursor to GIMPLE.
middle-end
The part of the compiler that performs optimizations on the intermediate representation, independent of the source language and target architecture.
libgcobol
The runtime library for the GCC COBOL compiler.
-fstatic-call
A GCC option for the COBOL compiler that influences how function calls are handled, potentially impacting performance.
Filed Under: cobolcompile timeoptimization