[Bug cobol/119456] gcobol: huge codegen for use of reference-modification (and missing optimization)
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Mar 2 21:40:32 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119456
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Robert Dubner <rdubner@gcc.gnu.org>:
https://gcc.gnu.org/g:435346eafadece9d045874ba000cb4a53f625f0c
commit r16-7853-g435346eafadece9d045874ba000cb4a53f625f0c
Author: Robert Dubner <rdubner@symas.com>
Date: Mon Mar 2 15:36:40 2026 -0500
cobol: Improved efficiency of code generated for MOVE "A" TO VAR(1:1).
[119456]
This PR rightly noted that COBOL source code which obviously could
result in simple machine language did not. These changes take advantage
of the compiler knowing, at compile time, the values of literal offsets
and lengths, and uses that knowledge to generate much more efficient
GENERIC for those cases.
gcc/cobol/ChangeLog:
PR cobol/119456
* genapi.cc (mh_source_is_literalA): Don't set refmod_e attribute
unless it is necessary.
(have_common_parent): Helper routine that determines whether two
COBOL variables are members of the same data description.
(mh_alpha_to_alpha): Modified for greater efficiency when table
subscripts and reference modification parameters are numeric
literals.
* genutil.cc (get_data_offset): Recognizes when table subscripts
and refmod offsets are numeric literals.
(refer_size): Recognizes when refmod offsets are numeric literals.
(refer_size_source): Recognizes when table subscripts are numeric
literals.
More information about the Gcc-bugs
mailing list