https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125616
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Robert Dubner <[email protected]>: https://gcc.gnu.org/g:666e349a989ae51e05463317019efa6b20c7c3b1 commit r17-1376-g666e349a989ae51e05463317019efa6b20c7c3b1 Author: Robert Dubner <[email protected]> Date: Fri Jun 5 11:43:59 2026 -0400 cobol: Properly DISPLAY COMP-1/-2 variables when "-dialect ibm" is in effect. [PR125616] Instead of GCOBOL's idiosyncratic display of COMP-1 and COMP-2 floating-point variables, these changes result in IBM's specified format when "-dialect ibm" is in effect. The specification says ⢠Internal floating-point numbers are converted to external floating-point numbers for display such that: â A COMP-1 item will display as if it had an external floating-point PICTURE clause of -.9(8)E-99. â A COMP-2 item will display as if it had an external floating-point PICTURE clause of -.9(17)E-99. That's what these changes implement. PR cobol/125616 gcc/cobol/ChangeLog: * genapi.cc (parser_enter_file): New __gg__dialects variable. (parser_division): Likewise. * genutil.cc: Likewise. * genutil.h: Likewise. * lang.opt.urls: Updated. * symbols.h (enum cbl_dialect_t): Move this enum to common-defs.h. libgcobol/ChangeLog: * common-defs.h (enum cbl_dialect_t): Move cbl_dialect_t here. * intrinsic.cc (__gg__trim_1): Make a formal parameter const. * libgcobol.cc (format_for_display_internal): Change the formatting of COMP-1/COMP2 when "-dialect ibm" is in force. (default_exception_handler): Whitespace formatting. (ec_type_disposition): Likewise. (ec_is_fatal): Likewise. gcc/testsuite/ChangeLog: * cobol.dg/group2/DISPLAY_IBM-formatted_COMP-1_and_COMP-2.cob: New test. * cobol.dg/group2/DISPLAY_IBM-formatted_COMP-1_and_COMP-2.out: New test.
