)]}'
{
  "commit": "f1f0ab5d2f371efeb26cbcee3eee46c903042e44",
  "tree": "91a26de9a0cdf9e45a0b918269b7a2c90312bb5d",
  "parents": [
    "166d5ff483f9410cea2f41c1a263918eeeffa18f"
  ],
  "author": {
    "name": "Robert Dubner",
    "email": "rdubner@symas.com",
    "time": "Wed Apr 01 22:40:13 2026 -0400"
  },
  "committer": {
    "name": "Robert Dubner",
    "email": "rdubner@symas.com",
    "time": "Thu Apr 02 14:35:25 2026 -0400"
  },
  "message": "cobol: Reduce CFG complexity; improve PERFORM return logic; improve INSPECT performance.\n\nControl FLow Graph complexity exploded because of indirect jumps. Those\nhave been replaced with SWITCH_EXPR.\n\nA number of calls to gg_get_address_of() have been replaced with\ngg_pointer_to_array() so that we properly get a pointer to the first element\nof arrays, rather than a pointer to an array object.\n\nThe speed of the INSPECT (Format 1) STATEMENT has been improved by breaking\nout a faster routine when the character set is single-byte-coded, like\nASCII or EBCDIC.\n\nA number of COBOL variables were improperly allocated as executable globals.\nThey are now allocated as per-function static variables for top-level\nCOBOL program-ids.\n\ngcc/cobol/ChangeLog:\n\n\t* cobol1.cc (cobol_langhook_handle_option): Handle OPT_Wrecording_mode.\n\t* gcobol.1: Documentation of pre-program registers.\n\t* genapi.cc (hijacker): Define new function hijacked code generation.\n\t(RETURN_WHEN_HIJACKED): Macro for wrapping if(hijacked)return;\n\t(hijacked): Either a boolean or false depending on ENABLE_HIJACKING.\n\t(set_exception_environment): Use gg_pointer_to_array instead of\n\tgg_get_address_of.\n\t(parser_statement_end): Formatting.\n\t(section_label): Change ALTER STATEMENT processing.\n\t(pseudo_return_push): Expand TRACE1 message.\n\t(pseudo_return_pop): Expand TRACE1 message; improved PERFORM processing.\n\t(find_procedure): Change how cbl_proc_t is allocated; improved PERFORM\n\tprocessing.\n\t(parser_enter_section): Changed ALTER statement processing.\n\t(parser_enter_paragraph): Likewise.\n\t(parser_goto): Use SWITCH_EXPR instead of indirect jump.\n\t(parser_perform): Likewise.\n\t(internal_perform_through): Likewise.\n\t(parser_enter_file): Use SWITCH_EXPR for implementing ENTRY statement.\n\t(parser_leave_file): Build table of values for the SWITCH_EXPR.\n\t(enter_program_common): Remove unused JMP *ptr.\n\t(parser_enter_program): Code to hijack code generation for a function\n\t\"dubner\" when ENABLE_HIJACKING is defined.\n\t(build_dispatch_switch): Generalize builder of SWITCH_EXPR.\n\t(build_alter_switch): Uses build_dispatch_switch.\n\t(build_entry_switch): Likewise.\n\t(build_perform_dispatcher): Likewise.\n\t(parser_end_program): Wrap build_perform_dispatcher() in if(!hijacked).\n\t(parser_init_list): Use RETURN_WHEN_HIJACKED; use gg_pointer_to_array()\n\tinstead of gg_get_address_of().\n\t(psa_FldLiteralN): Set TREE_READONLY(var_decl) \u003d 1.\n\t(parser_alphabet): use gg_pointer_to_array() instead of\n\tgg_get_address_of().\n\t(parser_assign): Formatting.\n\t(program_end_stuff): Call hijacking() when ENABLE_HIJACKING and the\n\tprogram-id is \"hijack\"; use gg_pointer_to_array().\n\t(parser_exit): Handle if(hijacked);\n\t(register_find): New static function to find XML-* COBOL variables.\n\t(parser_xml_parse): Updated XML PARSE statement handling.\n\t(initialize_the_data): Use RETURN_WHEN_HIJACKED.\n\t(establish_using): Change first-time-through processing.\n\t(parser_division): Change ENTRY statement processing.\n\t(parser_see_stop_run): Changed RETURN-CODE per-function variable\n\tprocessing.\n\t(parser_label_label): Use RETURN_WHEN_HIJACKED.\n\t(parser_label_goto): Likewise.\n\t(parser_perform_inline_times): Honor cbl_field_t offset for the count\n\tparameter.\n\t(inspect_tally): Use __gg__inspect_format_1_sbc() for SBC characters.\n\t(create_and_call): Use per-function RETURN-CODE.\n\t(parser_entry_activate): Eliminate static tree variables.\n\t(parser_entry): Use automatic tree variables.\n\t(parser_program_hierarchy): Use RETURN_WHEN_HIJACKED and\n\tgg_pointer_to_array().\n\t(build_temporaryN): New function compiled when ENABLE_HIJACKING.\n\t(hijack_for_development): Changed to generate minimal GENERIC.\n\t(actually_create_the_static_field): Use gg_structure_type_constructor\n\tto create the constructor for the static cblc_field_t VAR_DECL.\n\t(psa_FldLiteralA): Move where TREE attributes are established.\n\t(parser_local_add): Use gg_pointer_to_array().\n\t(parser_symbol_add): Use RETURN_WHEN_HIJACKED(); use gg_pointer_to_array().\n\t* gengen.cc (gg_append_statement): #if 0 around some debugging code.\n\t(gg_show_type): Expanded to display \"static\" and \"readonly\".\n\t(gg_find_field_in_struct): Moved and rewritten.\n\t(gg_get_structure_type_decl): New function.\n\t(gg_start_building_a_union): Eliminated.\n\t(gg_start_building_a_struct): Eliminated.\n\t(gg_add_field_to_structure): Eliminated.\n\t(gg_structure_type_constructor): New function.\n\t(gg_get_struct_type_decl): Eliminated.\n\t(gg_get_union_type_decl): Eliminated.\n\t(gg_get_local_struct_type_decl): Eliminated.\n\t(gg_get_filelevel_struct_type_decl): Eliminated.\n\t(gg_get_filelevel_union_type_decl): Eliminated.\n\t(gg_define_local_struct): Eliminated.\n\t(gg_assign_to_structure): Eliminated.\n\t(gg_define_array): Formatting.\n\t(gg_pointer_to_array): Returns ADDR_EXPR for \u0026array[0];\n\t(gg_goto): Comment reflecting why we aren\u0027t using it.\n\t* gengen.h (SHORT_P): Alias for build_pointer_type(short_integer_type_node);\n\t(struct gg_function_t): Changes mostly in support of SWITCH_EXPR.\n\t(gg_get_local_struct_type_decl): Eliminated declaration.\n\t(gg_get_filelevel_struct_type_decl): Likewise.\n\t(gg_get_filelevel_union_type_decl): Likewise.\n\t(gg_define_local_struct): Likewise.\n\t(gg_get_structure_type_decl): New declaration.\n\t(gg_structure_type_constructor): New declaration.\n\t(gg_assign_to_structure): Eliminated declaration.\n\t(gg_define_uchar_star): Changed declaration.\n\t(gg_pointer_to_array): New declaration.\n\t* genutil.cc: Removed unused globals; added var_decl_entry_index.\n\t* genutil.h: Likewise.\n\t* parse.y: Change program-id and REDEFINES handling.\n\t* parse_ante.h: Likewise.\n\t* scan_ante.h (is_refmod): Rewrite.\n\t* structs.cc (create_cblc_field_t): Use gg_get_structure_type_decl().\n\t* symbols.cc (return_code_register): Use per-program COBOL registers.\n\t(symbol_redefines_root): New function.\n\t(symbols_update): Use per-program COBOL registers.\n\t(symbol_table_init): Implement per-program registers.\n\t(symbol_registers_add): Likewise.\n\t(cbl_field_t::encode): Loosen COBOL level requirement.\n\t* symbols.h (struct cbl_proc_t): SWITCH_EXPR-based PERFORM returns.\n\t(symbol_redefines_root): New declaration.\n\t(symbol_registers_add): New declaration.\n\t(new_alphanumeric): New comment.\n\t* util.cc (FOR_JIM): Remove some unused demonstration code.\n\t(cbl_field_t::encode_numeric): Likewise.\n\nlibgcobol/ChangeLog:\n\n\t* Makefile.am: Include new libgcobol/inspect.cc file.\n\t* Makefile.in: Likewise.\n\t* charmaps.h: Remove global RETURN-CODE\n\t* constants.cc (struct cblc_field_t): Eliminate various globals.\n\t* gcobolio.h: Eliminate cblc_field_t::dummy member.\n\t* libgcobol.cc (funky_find): Moved to inspect.cc.\n\t(funky_find_wide): Likewise.\n\t(funky_find_backward): Likewise.\n\t(funky_find_wide_backward): Likewise.\n\t(normalize_id): Likewise.\n\t(match_lengths): Likewise.\n\t(the_alpha_and_omega): Likewise.\n\t(the_alpha_and_omega_backward): Likewise.\n\t(inspect_backward_format_1): Likewise.\n\t(__gg__inspect_format_1): Likewise.\n\t(inspect_backward_format_2): Likewise.\n\t(__gg__inspect_format_2): Likewise.\n\t(normalize_for_inspect_format_4): Likewise.\n\t(__gg__inspect_format_4): Likewise.\n\t(__gg__is_canceled): Simplify establishing the function return code.\n\t(__gg__pseudo_return_push): Work with integer indexes rather than\n\taddresses.\n\t(__gg__set_data_member): New function.\n\t* xmlparse.cc (xml_event): Use passed variables rather than globals.\n\t(__gg__xml_parse): Likewise.\n\t* inspect.cc: New file.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "19ef652a3f03e2f4d1fc0f23156d481e5662da29",
      "old_mode": 33188,
      "old_path": "gcc/cobol/cobol1.cc",
      "new_id": "0a5c71d85bd1b0c6cc2e9ad42857fa871dbf7b49",
      "new_mode": 33188,
      "new_path": "gcc/cobol/cobol1.cc"
    },
    {
      "type": "modify",
      "old_id": "17b02795e3c650e61a5de6bb866e525e185107f1",
      "old_mode": 33188,
      "old_path": "gcc/cobol/gcobol.1",
      "new_id": "d574f7f888c60208877942554e05965121396ef9",
      "new_mode": 33188,
      "new_path": "gcc/cobol/gcobol.1"
    },
    {
      "type": "modify",
      "old_id": "4f71f9b1152b496f4c1d24813956a67cb450c342",
      "old_mode": 33188,
      "old_path": "gcc/cobol/genapi.cc",
      "new_id": "b83e76815a4c6c5415a75862081cf7cdb234f29f",
      "new_mode": 33188,
      "new_path": "gcc/cobol/genapi.cc"
    },
    {
      "type": "modify",
      "old_id": "922d9844cfcb10586652db8e5bbab92e013904f8",
      "old_mode": 33188,
      "old_path": "gcc/cobol/gengen.cc",
      "new_id": "c6936725f6827d4b12352dbdf57fa4dc8c15f74e",
      "new_mode": 33188,
      "new_path": "gcc/cobol/gengen.cc"
    },
    {
      "type": "modify",
      "old_id": "0a716449d0798e23067f16a57d87878046605dce",
      "old_mode": 33188,
      "old_path": "gcc/cobol/gengen.h",
      "new_id": "e961b27a82b202ed788a67c42f2df5f8fc5d0cca",
      "new_mode": 33188,
      "new_path": "gcc/cobol/gengen.h"
    },
    {
      "type": "modify",
      "old_id": "4f2f4380909391777a8c5cfd2a70119bba6a7068",
      "old_mode": 33188,
      "old_path": "gcc/cobol/genutil.cc",
      "new_id": "b441063abe61b513e0b702c628511f47aecfd29e",
      "new_mode": 33188,
      "new_path": "gcc/cobol/genutil.cc"
    },
    {
      "type": "modify",
      "old_id": "3a2951e8175cc5beeff1ded977a2de0c8fccee9d",
      "old_mode": 33188,
      "old_path": "gcc/cobol/genutil.h",
      "new_id": "002a524d00d38faa079c78c89b7138de40ec03ad",
      "new_mode": 33188,
      "new_path": "gcc/cobol/genutil.h"
    },
    {
      "type": "modify",
      "old_id": "df7f29f9ce830af2b48cae5ba29bf87c5b8475f1",
      "old_mode": 33188,
      "old_path": "gcc/cobol/parse.y",
      "new_id": "c474f094803f06d337f15ae59b14634974c2cd20",
      "new_mode": 33188,
      "new_path": "gcc/cobol/parse.y"
    },
    {
      "type": "modify",
      "old_id": "068edc275ee05ba5ade02062c075f04f97298f06",
      "old_mode": 33188,
      "old_path": "gcc/cobol/parse_ante.h",
      "new_id": "6d33e55768612e187cc6c92ee0d0c505cbbb2666",
      "new_mode": 33188,
      "new_path": "gcc/cobol/parse_ante.h"
    },
    {
      "type": "modify",
      "old_id": "cd2798aa3ece731be93012be88d79ef2f2d95712",
      "old_mode": 33188,
      "old_path": "gcc/cobol/scan_ante.h",
      "new_id": "20fdf77470c95890fcb954496556df4c3934d56a",
      "new_mode": 33188,
      "new_path": "gcc/cobol/scan_ante.h"
    },
    {
      "type": "modify",
      "old_id": "69cfe9bf30d0d2af059a52ea84ce51b59bd09131",
      "old_mode": 33188,
      "old_path": "gcc/cobol/structs.cc",
      "new_id": "16bd4e4df53db8cfc8edebb41c8ae700d3e3738d",
      "new_mode": 33188,
      "new_path": "gcc/cobol/structs.cc"
    },
    {
      "type": "modify",
      "old_id": "55c40ffa5ca4a1f3fc97ab9a57c873e45a00cd76",
      "old_mode": 33188,
      "old_path": "gcc/cobol/symbols.cc",
      "new_id": "46beb97f9907054259c0a195fd1df8f7063c493d",
      "new_mode": 33188,
      "new_path": "gcc/cobol/symbols.cc"
    },
    {
      "type": "modify",
      "old_id": "87409857afc0ad4ad5f90066a666263c870fa953",
      "old_mode": 33188,
      "old_path": "gcc/cobol/symbols.h",
      "new_id": "d63d9a111494961eaf2a34dd38d70b8b1c58500e",
      "new_mode": 33188,
      "new_path": "gcc/cobol/symbols.h"
    },
    {
      "type": "modify",
      "old_id": "076bcf89a059a3d9fcb96cc44208532e89b53338",
      "old_mode": 33188,
      "old_path": "gcc/cobol/util.cc",
      "new_id": "c6bffdfb68b4fa612863b83a7f359655112d7c6a",
      "new_mode": 33188,
      "new_path": "gcc/cobol/util.cc"
    },
    {
      "type": "modify",
      "old_id": "de9ee0e3539174e894b8455d8f8cc7703dea88f4",
      "old_mode": 33188,
      "old_path": "libgcobol/Makefile.am",
      "new_id": "a129f0bded89534a45dfaeacadd14daeebbe1cb5",
      "new_mode": 33188,
      "new_path": "libgcobol/Makefile.am"
    },
    {
      "type": "modify",
      "old_id": "687fda2a5083fa92e41edaa9c6b16d81d4ff71f7",
      "old_mode": 33188,
      "old_path": "libgcobol/Makefile.in",
      "new_id": "0570345d0c1e342b8384c4766c0255e006d1883e",
      "new_mode": 33188,
      "new_path": "libgcobol/Makefile.in"
    },
    {
      "type": "modify",
      "old_id": "c8fa82264d1801bf3e50b648a612f40ae2b6d5c1",
      "old_mode": 33188,
      "old_path": "libgcobol/charmaps.h",
      "new_id": "477553cd3706b7a2cbe26cd80c76045159f915eb",
      "new_mode": 33188,
      "new_path": "libgcobol/charmaps.h"
    },
    {
      "type": "modify",
      "old_id": "8db6e9a38e813f058be3697d4c7573395ba54f30",
      "old_mode": 33188,
      "old_path": "libgcobol/constants.cc",
      "new_id": "8be304cb5f2722ed1831fe5b051622367b24b4ba",
      "new_mode": 33188,
      "new_path": "libgcobol/constants.cc"
    },
    {
      "type": "modify",
      "old_id": "731b41079f70714e8e5864f2cf7e569caa0c0bad",
      "old_mode": 33188,
      "old_path": "libgcobol/gcobolio.h",
      "new_id": "e97803ee50b448e174d17c86bb5b79edf66b46fb",
      "new_mode": 33188,
      "new_path": "libgcobol/gcobolio.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "7e6d1648e72d2680999b220e595174ff2c9b1db3",
      "new_mode": 33188,
      "new_path": "libgcobol/inspect.cc"
    },
    {
      "type": "modify",
      "old_id": "3eca7787ee1ce7dceed5c48d6b9aa009c71ee58c",
      "old_mode": 33188,
      "old_path": "libgcobol/libgcobol.cc",
      "new_id": "9e3d8a4db113d68cc81827d29cdaffded8f29c39",
      "new_mode": 33188,
      "new_path": "libgcobol/libgcobol.cc"
    },
    {
      "type": "modify",
      "old_id": "b480cff6c8af706373ccbe591a6534512370aae9",
      "old_mode": 33188,
      "old_path": "libgcobol/xmlparse.cc",
      "new_id": "7f961aeac24885d57f1f1d9bfc206b44a5a24905",
      "new_mode": 33188,
      "new_path": "libgcobol/xmlparse.cc"
    }
  ]
}
