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

Cobol compiler validates ADD CORRESPONDING operand count.

Cobol compiler now validates ADD CORRESPONDING takes exactly two operands, fixing a bug and preventing an ICE.

The Cobol compiler now enforces that the ADD CORRESPONDING statement must take exactly two operands. This change, which addresses bug RT 3665, provides a more specific error message for incorrect operand counts. Additionally, a related fix prevents an internal compiler error (ICE) that could occur when attempting to use the WRITE statement in syntax-only mode.

In Details

The cobol parser, specifically in parse.y, now includes a diagnostic to enforce that ADD CORRESPONDING must be used with precisely two operands. This addresses RT 3665. The genapi.cc file also incorporates RETURN_IF_PARSE_ONLY into parser_file_write to prevent an ICE during syntax-only compilations.

For Context
ADD CORRESPONDING
A COBOL statement used to add corresponding data items between two group items. It operates on data items that have the same name within the group structures.
syntax-only mode
A compiler mode where the compiler only checks for syntactical correctness of the code without performing any actual code generation or optimization.
ICE (Internal Compiler Error)
An unexpected error that occurs within the compiler itself, halting the compilation process. These are typically bugs in the compiler that need to be fixed by the developers.
Filed Under: cobolcompiler bugvalidation