149 Commits

Author SHA1 Message Date
GCC Administrator
85af11f7bf Daily bump. 2026-02-20 00:16:32 +00:00
Robert Dubner
e7356e34b2 cobol: Improve generated code for fast_add and fast_subtract.
These changes improve the efficiency of generated code by recognizing
more instances where operations are on little-endian binary COBOL
variables and then avoiding calls to libgcobol.  The generated code
also reduces the number of intermediate variables created for that
little-endian arithmetic.

gcc/cobol/ChangeLog:

	* genapi.cc (tree_type_from_field_type): Move static code.
	(compare_binary_binary): Identify little-endian compares.
	(psa_FldLiteralN): Eliminate obsolete development code; make the
	initialized variables TREE_CONSTANT.
	(parser_symbol_add): Adjust for modified FldLiteralN.
	* genmath.cc (all_results_binary): Renamed. Modified for fastness.
	(all_results_integer): Likewise.
	(all_refers_integer): Likewise.
	(largest_binary_term): Likewise.
	(fast_add): Expand conditions.  Use get_binary_value_tree.
	(fast_subtract): Likewise.
	(fast_multiply): Expand conditions.
	(fast_divide): Expand conditions.
	(parser_add): Avoid fast_add when error or not-error are specified.
	(parser_multiply): Likewise.
	(parser_divide): Likewise.
	(parser_subtract): Likewise.
	* genutil.cc (tree_type_from_field): Disable; flagged for removal.
	(get_binary_value): Use get_binary_value_tree.
	(get_binary_value_tree): Avoid intermediate variables when possible.
	(refer_is_clean): Formatting.
	(is_pure_integer): Refine test for little-endian binary.
	* genutil.h (get_binary_value_tree): New declaration.
	(is_pure_integer): New declaration.
	* symbols.cc (symbol_table_init): Explanatory ZEROS comment.

libgcobol/ChangeLog:

	* gfileio.cc (__gg__file_reopen): Raise exception on failed OPEN
	* gmath.cc (__gg__fixed_phase2_assign_to_c): Let pointer arithmetic
	go negative.
	(__gg__subtractf2_fixed_phase1): Edit a comment.
2026-02-18 23:21:22 -05:00
GCC Administrator
83720e914d Daily bump. 2026-02-15 00:16:25 +00:00
Jakub Jelinek
3a1bb1b70d libgcobol: Add --with-target-libxml2{,-lib,-include}= configure options [PR122839]
The following patch adds new configure options similar to ObjC/Algol68
--with-bdw-gc{,-lib,-include}= configure options where one can override
the default of -I /usr/include/libxml2 and -lxml2 for finding libxml2
headers and library.  Similarly to the bdw-gc options, the override can
be for all multilibs or just specific to each multilib.

Tested also with
../configure --enable-languages=c,c++,cobol --with-target-libxml2=/tmp/libxml2 \
--disable-bootstrap --disable-libsanitizer --disable-libgomp

2026-02-14  Jakub Jelinek  <jakub@redhat.com>

	PR cobol/122839
	* configure.ac (--with-target-libxml2, --with-target-libxml2-include,
	--with-target-libxml2-lib): New configure options, use those to find
	libxml2.
	(LIBXML2_CPPFLAGS, LIBXML2_LIBS): New AC_SUBSTs.
	* Makefile.am (AM_CPPFLAGS): Add $(LIBXML2_CPPFLAGS) rather than
	-I /usr/include/libxml2.
	(libgcobol_la_LDFLAGS): Add $(LIBXML2_LIBS).
	* configure: Regenerate.
	* config.h.in: Regenerate.
	* Makefile.in: Regenerate.

	* doc/install.texi (COBOL-Specific Options): New.
2026-02-14 18:05:38 +01:00
GCC Administrator
efc76a7f33 Daily bump. 2026-02-13 00:16:32 +00:00
Robert Dubner
9db703c556 cobol: Eliminate strict-aliasing violations. [PR121499]
Code violating strict aliasing has been refactored.

libgcobol is now being built with
-fstrict-aliasing -Wstrict-aliasing -Wstrict-aliasing=3

Copyright boilerplate has been updated to the year 2026 throughout gcc/cobol
and libgcobol.

gcc/cobol/ChangeLog:

	* cbldiag.h: Copyright updated to 2026.
	* cdf-copy.cc: Likewise.
	* cdf.y: Likewise.
	* cdfval.h: Likewise.
	* cobol-system.h: Likewise.
	* convert.cc: Likewise.
	* copybook.h: Likewise.
	* except.cc: Likewise.
	* exceptg.h: Likewise.
	* genapi.cc: Likewise.
	* genapi.h: Likewise.
	* gengen.cc: Likewise.
	* gengen.h: Likewise.
	* genmath.cc: Likewise.
	* genmath.h: Likewise.
	* genutil.cc: Likewise.
	* genutil.h: Likewise.
	* inspect.h: Likewise.
	* lang-specs.h: Likewise.
	* lexio.cc: Likewise.
	* lexio.h: Likewise.
	* messages.cc: Likewise.
	* parse.y: Likewise.
	* parse_ante.h: Likewise.
	* parse_util.h: Likewise.
	* scan.l: Likewise.
	* scan_ante.h: Likewise.
	* scan_post.h: Likewise.
	* show_parse.h: Likewise.
	* structs.cc: Likewise.
	* structs.h: Likewise.
	* symbols.cc: Likewise.
	* symbols.h: Likewise.
	* symfind.cc: Likewise.
	* util.cc: Likewise.
	* util.h: Likewise.

libgcobol/ChangeLog:

	PR cobol/121499
	* LICENSE: Copyright updated to 2026.
	* Makefile.am: Compile with -fstrict-aliasing.
	* Makefile.in: Autoreconf.
	* acinclude.m4: Copyright updated to 2026.
	* charmaps.cc: Likewise.
	* charmaps.h: Likewise.
	* common-defs.h: Likewise.
	* configure.tgt: Likewise.
	* constants.cc: Likewise.
	* ec.h: Likewise.
	* encodings.h: Likewise.
	* exceptl.h: Likewise.
	* gcobolio.h: Likewise.
	* gfileio.cc: Likewise.
	* gfileio.h: Likewise.
	* gmath.cc (multiply_int256_by_int64): Eliminate aliasing.
	(divide_int256_by_int64): Likewise.
	(multiply_int128_by_int128): Likewise.
	(divide_int128_by_int128): Likewise.
	* gmath.h: Copyright updated to 2026.
	* intrinsic.cc: Likewise.
	* io.cc: Likewise.
	* io.h: Likewise.
	* libgcobol.cc: Likewise.
	* libgcobol.h: Likewise.
	* stringbin.cc: Likewise.
	* stringbin.h: Likewise.
	* valconv.cc: Likewise.
	* valconv.h: Likewise.
	* xmlparse.cc: Likewise.
2026-02-12 15:38:54 -05:00
Robert Dubner
e0bbad05ca cobol: Repair CALL ... USING BY VALUE.
These changes cause CALL ... USING BY VALUE to work properly for a
wider range of COBOL variables types, values, and sizes.  Some sizes
of numeric-display variables didn't work, some didn't work for negative
values, and floating-extended didn't work at all.  Now they do.

Fourteen new DejaGnu tests cover this repaired capability.

gcc/cobol/ChangeLog:

	* genapi.cc (establish_using): Use a 128-bit type for
	float-extended; handle numeric-edited values of different sizes
	and signs correctly.
	(create_and_call):  Use a 128-bit type for float-extended.

libgcobol/ChangeLog:

	* Makefile.am: Temporarily continue to use -fno-strict-aliasing.
	* Makefile.in: Likewise.
	* libgcobol.cc (__gg__fetch_call_by_value_value): Simplify handling
	of FldFloat.
	(__gg__assign_value_from_stack): Likewise.
	(__gg__unstring): Avoid uninitialized variable error.
	(__gg__look_at_int128): New function useful for debugging.
	(__gg__look_at_pointer): Likewise.
	* xmlparse.cc (xml_event): Implement namespace XML.
	(cdataBlock): Likewise.
	(characters): Likewise.
	(__gg__xml_parse):  Likewise.

gcc/testsuite/ChangeLog:

	* cobol.dg/group2/USING_COMP-3_BY_REFERENCE.cob: New test.
	* cobol.dg/group2/USING_COMP-3_BY_REFERENCE.out: New test.
	* cobol.dg/group2/USING_COMP-3_BY_VALUE.cob: New test.
	* cobol.dg/group2/USING_COMP-3_BY_VALUE.out: New test.
	* cobol.dg/group2/USING_FLOAT-SLX_BY_REFERENCE.cob: New test.
	* cobol.dg/group2/USING_FLOAT-SLX_BY_REFERENCE.out: New test.
	* cobol.dg/group2/USING_FLOAT-SLX_BY_VALUE.cob: New test.
	* cobol.dg/group2/USING_FLOAT-SLX_BY_VALUE.out: New test.
	* cobol.dg/group2/USING_NumericDisplay_BY_REFERENCE.cob: New test.
	* cobol.dg/group2/USING_NumericDisplay_BY_REFERENCE.out: New test.
	* cobol.dg/group2/USING_NumericDisplay_BY_VALUE.cob: New test.
	* cobol.dg/group2/USING_NumericDisplay_BY_VALUE.out: New test.
	* cobol.dg/group2/USING_Signed_-_COMP-3_BY_REFERENCE.cob: New test.
	* cobol.dg/group2/USING_Signed_-_COMP-3_BY_REFERENCE.out: New test.
	* cobol.dg/group2/USING_Signed_-_COMP-3_BY_VALUE.cob: New test.
	* cobol.dg/group2/USING_Signed_-_COMP-3_BY_VALUE.out: New test.
	* cobol.dg/group2/USING_Signed_-_NumericDisplay_BY_REFERENCE.cob: New test.
	* cobol.dg/group2/USING_Signed_-_NumericDisplay_BY_REFERENCE.out: New test.
	* cobol.dg/group2/USING_Signed_-_NumericDisplay_BY_VALUE.cob: New test.
	* cobol.dg/group2/USING_Signed_-_NumericDisplay_BY_VALUE.out: New test.
	* cobol.dg/group2/USING_Signed___COMP-3_BY_REFERENCE.cob: New test.
	* cobol.dg/group2/USING_Signed___COMP-3_BY_REFERENCE.out: New test.
	* cobol.dg/group2/USING_Signed___COMP-3_BY_VALUE.cob: New test.
	* cobol.dg/group2/USING_Signed___COMP-3_BY_VALUE.out: New test.
	* cobol.dg/group2/USING_Signed___NumericDisplay_BY_REFERENCE.cob: New test.
	* cobol.dg/group2/USING_Signed___NumericDisplay_BY_REFERENCE.out: New test.
	* cobol.dg/group2/USING_Signed___NumericDisplay_BY_VALUE.cob: New test.
	* cobol.dg/group2/USING_Signed___NumericDisplay_BY_VALUE.out: New test.
2026-02-12 11:43:08 -05:00
GCC Administrator
adaeecb1f5 Daily bump. 2026-02-06 00:16:39 +00:00
Robert Dubner
203cbbc22f cobol: Use _perform_line_pairs instead of injecting encoded label names.
The gcobol front end has been communicating with GDB-COBOL by encoding
information into labels that are injected into the assembly language
with ASM_EXPR nodes.  That behavior is, at best, questionable.

These changes replace the "proccall" and "procret" types of those labels
in favor of a static _perform_line_pairs table that contains the same
information and is accessible by GDB-COBOL by virtue of its known name.

That table allows GDB-COBOL to "NEXT over COBOL PERFORM" statements in a
way that is familiar to users who have used "NEXT over function call".

Eventually that information should find its way into the .debug_info
section, but at the present time I don't know how to do that on either
the compiler or debugger sides.

Most of these changes involve eliminating gg_insert_into_assembler calls
and replacing them with the perform_is_armed/perform_line_pairs logic.

Some COBOL variable initialization changes crept in here, as well.

gcc/cobol/ChangeLog:

	* genapi.cc (DEFAULT_LINE_NUMBER): Remove unused #define.
	(parser_statement_begin): Implement perform_is_armed logic.
	(initialize_variable_internal): Handle both real and int types in
	SHOW_PARSE tracing.
	(section_label): Comment a renumbered insert_nop() for gdb-cobol
	logic.
	(paragraph_label): Likewise.
	(leave_procedure): Eliminate call to gg_insert_into_assembler().
	(parser_enter_section): Renumber insert_nop().
	(parser_perform): Eliminate call to gg_insert_into_assembler().
	(parser_perform_times): Likewise.
	(internal_perform_through): Likewise.
	(internal_perform_through_times): Likewise.
	(parser_leave_file): Create the static _perform_line_pairs table.
	(parser_sleep): Renumber insert_nop().
	(parser_division): Remove calls to initialize_the_data().
	(parser_perform_start): New call to insert_nop().
	(parser_perform_conditional): Likewise.
	(perform_outofline_before_until): Expanded comment.
	(perform_outofline_after_until): Eliminate call to
	gg_insert_into_assembler().
	(perform_outofline_testafter_varying): Likewise.
	(perform_outofline_before_varying): Likewise.
	(perform_inline_testbefore_varying):  New call to insert_nop().
	(create_and_call): Change a comment.
	* gengen.cc (gg_create_goto_pair): Change characteristics of a
	label.
	* parse.y: Change how data are initialized.
	* parse_ante.h (field_type_update): Likewise.
	* symbols.cc (cbl_field_t::set_signable): Likewise.
	(cbl_field_t::encode): Likewise.
	* symbols.h (struct cbl_field_t): Likewise.
	* util.cc (symbol_field_type_update): Likewise.
	(cbl_field_t::encode_numeric): Likewise.

libgcobol/ChangeLog:

	* valconv.cc (__gg__string_to_numeric_edited): Explanatory comment.
2026-02-05 15:03:26 -05:00
GCC Administrator
ddda478641 Daily bump. 2026-01-18 00:16:31 +00:00
Robert Dubner
2c95d4c742 cobol: Support National characters and Unicode runtime encoding.
The last few months have seen an evolution in the COBOL compiler.  Up
until now it could use either CP1252/ASCII or CP1140/EBCDIC to represent
alphanumeric variables and numeric types that are stored as character
strings.  With these changes, those types can be represented in many
other single-byte encodings, as well as UTF16 and UTF32 encodings.

These changes required extensive changes.

1) The initial parsing has to handle the extended capabilities.

2) Each run-time variable designates its character set.

3) The run-time code has to be able to handle wide characters.

Since the development took place over a period of time, other changes
crept in. In particular, there is an expansion of bindings making
certain POSIX functions available to the COBOL programmer.

There has also been an expansion of gcobol's use of the GCC diagnostic
framework.

Co-Authored-By: Robert Dubner <rdubner@symas.com>
Co-Authored-By: James K. Lowden <jklowden@cobolworx.com>

gcc/cobol/ChangeLog:

	* cbldiag.h (struct cbl_loc_t): Diagnostics.
	(enum cbl_diag_id_t): Diagnostics.
	* cdf.y: Includes.
	* cobol1.cc (cobol_warning_suppress): Diagnostics.
	(cobol_langhook_handle_option): Implement -fexec-charset.  Expand
	the use of diagnostics.
	* gcobc: Expand options and warnings.
	* gcobol.1: Documentation.
	* genapi.cc (level_88_helper): Charsets.
	(get_level_88_domain): Charsets.
	(get_class_condition_string): Charsets.
	(function_pointer_from_name): Charsets.
	(initialize_variable_internal):  Charsets.
	(parser_initialize): Charsets.
	(get_binary_value_from_float): Charsets.
	(get_bytes_needed): Charsets.
	(cobol_compare): Charsets.
	(move_tree): Eliminate function.
	(move_tree_to_field): Eliminate function.
	(get_string_from): Eliminate function.
	(parser_init_list): Charsets.
	(psa_FldLiteralN): Charsets.
	(parser_accept_date_yymmdd): Charsets.
	(parser_accept_date_yyyymmdd): Charsets.
	(parser_accept_date_yyddd): Charsets.
	(parser_accept_date_yyyyddd): Charsets.
	(parser_accept_date_dow): Charsets.
	(parser_accept_date_hhmmssff): Charsets.
	(parser_alphabet): Charsets.
	(parser_alphabet_use): Charsets.
	(parser_display_internal): Charsets.
	(get_literalN_value): Charsets.
	(tree_type_from_field_type): Charsets.
	(program_end_stuff): Charsets.
	(walk_initialization): Charsets.
	(parser_xml_parse): Charsets.
	(initialize_the_data): Charsets.
	(establish_using): Charsets.
	(parser_setop): Charsets.
	(parser_set_conditional88): Charsets.
	(parser_file_add): Charsets.
	(get_the_filename): Eliminate function.
	(parser_file_open): Charsets.
	(parser_file_delete_file): Charsets.
	(parser_file_start): Charsets.
	(parser_module_name): Charsets.
	(parser_intrinsic_find_string): New function.
	(parser_intrinsic_numval_c): Charsets.
	(parser_intrinsic_convert): New function.
	(parser_intrinsic_call_1): Charsets.
	(create_and_call): Charsets.
	(mh_identical): Charsets.
	(mh_source_is_literalN): Charsets.
	(float_type_of): Charsets.
	(mh_dest_is_float): Charsets.
	(mh_numeric_display): Charsets.
	(mh_little_endian): Charsets.
	(mh_source_is_group): Charsets.
	(mh_source_is_literalA): Charsets.
	(move_helper): Charsets.
	(binary_initial): Eliminate function.
	(digits_from_int128): Eliminate function.
	(digits_from_float128): Eliminate function.
	(initial_from_initial):  Eliminate function.
	(convert_data_initial): New function.
	(actually_create_the_static_field): Charsets.
	(psa_new_var_decl): Charsets.
	(psa_FldLiteralA): Charsets.
	(parser_local_add): Charsets.
	(parser_symbol_add): Charsets.
	* genapi.h (parser_intrinsic_convert): New function.
	(parser_intrinsic_find_string): New function.
	* genmath.cc (arithmetic_operation): Charsets.
	(largest_binary_term): Charsets.
	(fast_add): Charsets.
	(fast_subtract): Charsets.
	(fast_multiply): Charsets.
	(fast_divide): Charsets.
	(parser_subtract): Fix subtract float from float.
	* genutil.cc (get_any_capacity): Charsets.
	(get_and_check_refstart_and_reflen): Charsets.
	(get_data_offset): Charsets.
	(get_binary_value): Charsets.
	(tree_type_from_field): Charsets.
	(copy_little_endian_into_place): Charsets.
	(get_literal_string): Charsets.
	(refer_is_clean): Charsets.
	(refer_fill_depends): Charsets.
	(refer_size_source): Comment.
	* lang-specs.h: Charsets.
	* lang.opt: Charsets.
	* lexio.cc (parse_copy_directive): Diagnostics.
	* messages.cc (cbl_diagnostic_kind): Diagnostics.
	(cobol_warning_suppress): Diagnostics.
	* parse.y: Many changes for charsets and diagnostics.
	* parse_ante.h (MAXLENGTH_FORMATTED_DATE): Charsets.
	(MAXLENGTH_FORMATTED_TIME): Charsets.
	(MAXLENGTH_CALENDAR_DATE): Charsets.
	(MAXLENGTH_FORMATTED_DATETIME): Charsets.
	(consistent_encoding_check): Charsets.
	(enum data_clause_t): Charsets.
	(new_alphanumeric): Charsets.
	(name_of): Charsets.
	(class eval_subject_t): Charsets.
	(struct domain_t): Charsets.
	(struct file_list_t): Charsets.
	(current_encoding): Charsets.
	(new_tempnumeric): Charsets.
	(is_integer_literal): Charsets.
	(new_literal): Charsets.
	(new_constant): Charsets.
	(conditional_set): Charsets.
	(field_find): Charsets.
	(valid_redefine): Charsets.
	(field_value_all): Charsets.
	(parent_has_picture): Charsets.
	(parent_has_value): Charsets.
	(blank_pad_initial): Charsets.
	(blankit): Charsets.
	(cbl_field_t::blank_initial): Charsets.
	(value_encoding_check): Charsets.
	(cbl_field_t::set_initial): Charsets.
	(field_alloc): Charsets.
	(parser_move_carefully): Charsets.
	(data_division_ready): Charsets.
	(anybody_redefines): Charsets.
	(procedure_division_ready): Charsets.
	(file_section_parent_set): Charsets.
	(field_binary_usage): Charsets.
	(goodnight_gracie): Formatting.
	* scan.l: Charsets.
	* scan_ante.h (numstr_of): Charsets.
	(typed_name): Charsets.
	* show_parse.h: Charsets.
	* structs.cc (create_cblc_file_t): Charsets.
	* symbols.cc (symbol_table_extend): Charsets.
	(WARNING_FIELD): Diagnostics.
	(constq): Charsets.
	(elementize): Charsets.
	(field_size): Charsets.
	(cbl_field_t::set_attr): Eliminate run-time component.
	(cbl_field_t::clear_attr): Eliminate run-time component.
	(field_memsize): Charsets.
	(cbl_encoding_str): Charsets.
	(symbols_dump): Charsets.
	(is_variable_length): Formatting.
	(field_str): Charsets.
	(extend_66_capacity): Charsets.
	(operator<<): Charsets.
	(symbols_update): Charsets.
	(symbol_field_parent_set): Charsets.
	(symbol_table_init): Charsets.
	(numeric_group_attrs): Charsets.
	(symbol_field_add): Charsets.
	(symbol_field_alias): Charsets.
	(fd_record_size_cmp): Charsets.
	(symbol_file_record_sizes): Charsets.
	(cbl_alphabet_t::reencode): Charsets.
	(symbol_temporary_location): Charsets.
	(new_literal_2): Charsets.
	(new_alphanumeric): Charsets.
	(standard_internal): Charsets.
	(cbl_field_t::codeset_t::stride): Charsets.
	(cobol_alpha_encoding): Charsets.
	(cobol_national_encoding): Charsets.
	(new_temporary): Charsets.
	(new_literal_float): Charsets.
	(cbl_field_t::is_ascii): Charsets.
	(cbl_field_t::internalize): Eliminate function.
	(cbl_field_t::source_code_check): Charsets.
	(iconv_cd): Charsets.
	(cbl_field_t::encode): New function for charsets.
	(cbl_field_t::set_capacity): Charsets.
	(cbl_field_t::add_capacity): Charsets.
	(cbl_field_t::char_capacity): Charsets.
	(symbol_label_section_exists): Charsets.
	(size): Charsets.
	(validate_numeric_edited): Charsets.
	* symbols.h (cobol_alpha_encoding): Charsets.
	(cobol_national_encoding): Charsets.
	(consistent_encoding_check): Charsets.
	(class cbl_domain_elem_t): Charsets.
	(struct cbl_domain_t): Charsets.
	(struct cbl_field_data_t): Charsets.
	(class cbl_field_data_t): Charsets.
	(struct cbl_subtable_t): Charsets.
	(struct cbl_field_t): Charsets.
	(new_literal_float): Charsets.
	(new_temporary): Charsets.
	(new_literal_2): Charsets.
	(symbol_temporary_location): Charsets.
	(class temporaries_t): Charsets.
	(struct symbol_elem_t): Charsets.
	(symbol_elem_of): Charsets.
	(symbol_unique_index): Charsets.
	(cbl_field_type_name): Charsets.
	(validate_numeric_edited): Charsets.
	* token_names.h: Charsets.
	* util.cc (cdf_literalize): Charsets.
	(cbl_field_type_name): Charsets.
	(determine_intermediate_type): Charsets.
	(is_alpha_edited): Charsets.
	(cbl_field_data_t::is_alpha_edited): Charsets.
	(symbol_field_type_update): Charsets.
	(redefine_field): Charsets.
	(FIXED_WIDE_INT): Charsets.
	(dirty_to_binary): Charsets.
	(digits_from_int128): Charsets.
	(binary_initial): Charsets.
	(cbl_field_t::encode_numeric): Charsets.
	(FOR_JIM): Temporary conditional demonstration code.
	(parse_error_inc): Diagnostics.
	(parse_error_count): Diagnostics.
	(cbl_field_t::report_invalid_initial_value): Diagnostics.
	(valid_move): Diagnostics.
	(type_capacity): Charsets.
	(symbol_unique_index): New function.
	(cbl_unimplementedw): Formatting.

libgcobol/ChangeLog:

	* charmaps.cc (__gg__encoding_iconv_name): Charsets.
	(__gg__encoding_iconv_valid): Charsets.
	(__gg__encoding_iconv_type): Charsets.
	(encoding_descr): Charsets.
	(__gg__encoding_iconv_descr): Charsets.
	(__gg__iconverter): Charsets.
	(__gg__miconverter): Charsets.
	* charmaps.h (NOT_A_CHARACTER): Charsets.
	(ascii_nul): Charsets.
	(ascii_bang): Charsets.
	(__gg__encoding_iconv_type): Charsets.
	(__gg__iconverter): Charsets.
	(__gg__miconverter): Charsets.
	(DEFAULT_32_ENCODING): Charsets.
	(class charmap_t): Charsets.
	(__gg__get_charmap): Charsets.
	* common-defs.h (enum cbl_field_attr_t):
	(enum cbl_figconst_t): Formatting.
	(LOW_VALUE_E): Handle enum arithmetic.
	(ZERO_VALUE_E): Handle enum arithmetic.
	(SPACE_VALUE_E): Handle enum arithmetic.
	(QUOTE_VALUE_E): Handle enum arithmetic.
	(HIGH_VALUE_E): Handle enum arithmetic.
	(enum convert_type_t): Enum for new FUNCTION CONVERT.
	(struct cbl_declarative_t): Formatting.
	* encodings.h (struct encodings_t): Charsets.
	* gcobolio.h: Charsets.
	* gfileio.cc (get_filename): Rename to establish filename.
	(establish_filename): Renamed from get_filename.
	(relative_file_delete):  Charsets.
	(__io__file_remove): Moved.
	(trim_in_place): Charsets.
	(relative_file_start): Charsets.
	(relative_file_rewrite): Charsets.
	(relative_file_write): Charsets.
	(sequential_file_write): Charsets.
	(line_sequential_file_read): Charsets.
	(sequential_file_read): Charsets.
	(relative_file_read): Charsets.
	(__gg__file_reopen): Charsets.
	(__io__file_open): Charsets.
	(__io__file_close): Charsets.
	(gcobol_fileops): Charsets.
	(__gg__file_open): Charsets.
	(__gg__file_remove): Charsets.
	* gfileio.h (__gg__file_open): Charsets.
	* gmath.cc (__gg__subtractf1_float_phase2): Comment.
	(__gg__subtractf2_float_phase1): Comment.
	(__gg__multiplyf1_phase2): Comment.
	* intrinsic.cc (is_zulu_format): Charsets.
	(string_to_dest): Charsets.
	(get_all_time): Charsets.
	(ftime_replace): Charsets.
	(__gg__char): Charsets.
	(__gg__current_date): Charsets.
	(__gg__formatted_current_date): Charsets.
	(__gg__formatted_date): Charsets.
	(__gg__formatted_datetime): Charsets.
	(__gg__formatted_time): Charsets.
	(change_case): Charsets.
	(__gg__upper_case): Charsets.
	(numval): Charsets.
	(numval_c): Charsets.
	(__gg__trim): Charsets.
	(__gg__reverse): Charsets.
	(fill_cobol_tm): Charsets.
	(__gg__seconds_from_formatted_time): Charsets.
	(__gg__hex_of): Charsets.
	(__gg__numval_f): Charsets.
	(__gg__test_numval_f): Charsets.
	(__gg__locale_date): Charsets.
	(__gg__locale_time): Charsets.
	(__gg__locale_time_from_seconds): Charsets.
	* libgcobol.cc (NO_RDIGITS): Alias for (0).
	(__gg__move): Forward reference.
	(struct program_state): Charsets.
	(cstrncmp): Charsets.
	(__gg__init_program_state): Charsets.
	(edited_to_binary): Charsets.
	(var_is_refmod): Comment.
	(__gg__power_of_ten): Reworked data initialization.
	(__gg__scale_by_power_of_ten_1): Likewise.
	(__gg__scale_by_power_of_ten_2): Likewise.
	(value_is_too_big): Likewise.
	(binary_to_big_endian): Likewise.
	(binary_to_little_endian): Likewise.
	(int128_to_int128_rounded): Likewise.
	(get_binary_value_local): Likewise.
	(get_init_value): Likewise.
	(f128_to_i128_rounded): Likewise.
	(__gg__initialization_values): Likewise.
	(int128_to_field): Likewise.
	(__gg__get_date_yymmdd): Charsets.
	(__gg__field_from_string): Charsets.
	(field_from_ascii): Charsets.
	(__gg__get_date_yyyymmdd): Charsets.
	(__gg__get_date_yyddd): Charsets.
	(__gg__get_yyyyddd): Charsets.
	(__gg__get_date_dow): Charsets.
	(__gg__get_date_hhmmssff): Charsets.
	(collation_position): Charsets.
	(uber_compare): Charsets.
	(__gg__dirty_to_binary): Charsets.
	(__gg__dirty_to_float): Charsets.
	(format_for_display_internal): Charsets.
	(compare_88): Charsets.
	(get_float128): Reworked.
	(compare_field_class): Charsets.
	(interconvert): Charsets.
	(compare_strings): Charsets.
	(__gg__compare_2): Charsets.
	(compare_two_records): Charsets.
	(__gg__sort_table): Charsets.
	(init_var_both): Charsets.
	(__gg__initialize_variable_clean): Charsets.
	(alpha_to_alpha_move_from_location): Charsets.
	(__gg__memdup): New function.
	(alpha_to_alpha_move): Charsets.
	(__gg__sort_workfile): Charsets.
	(__gg__merge_files): Charsets.
	(funky_find_wide): Charsets.
	(funky_find_wide_backward): Charsets.
	(normalize_id): Charsets.
	(match_lengths): Charsets.
	(the_alpha_and_omega): Charsets.
	(the_alpha_and_omega_backward): Charsets.
	(inspect_backward_format_1): Charsets.
	(__gg__inspect_format_1): Charsets.
	(inspect_backward_format_2): Charsets.
	(__gg__inspect_format_2): Charsets.
	(normalize_for_inspect_format_4): Charsets.
	(__gg__inspect_format_4): Charsets.
	(move_string): Charsets.
	(brute_force_trim): Charsets.
	(__gg__string): Charsets.
	(display_both): Charsets.
	(__gg__display_string): Charsets.
	(__gg__bitwise_op): Charsets.
	(is_numeric_display_numeric): Charsets.
	(is_alpha_a_number): Charsets.
	(classify_numeric_type): Charsets.
	(classify_alphabetic_type): Charsets.
	(__gg__classify): Charsets.
	(__gg__convert_encoding): Charsets.
	(accept_envar): Charsets.
	(__gg__accept_envar): Charsets.
	(__gg__get_argc): Charsets.
	(__gg__get_argv): Charsets.
	(__gg__get_command_line): Charsets.
	(__gg__parser_set_conditional): Charsets.
	(__gg__literaln_alpha_compare): Charsets.
	(string_in): Charsets.
	(__gg__unstring): Charsets.
	(__gg__integer_from_float128): Charsets.
	(__gg__adjust_dest_size): Charsets.
	(__gg__just_mangle_name): Charsets.
	(__gg__function_handle_from_name): Charsets.
	(get_the_byte): Charsets.
	(__gg__refer_from_string): Charsets.
	(__gg__refer_from_psz): Charsets.
	(__gg__find_string): Charsets.
	(convert_for_convert): Charsets.
	(__gg__convert): Charsets.
	* libgcobol.h (__gg__compare_2): Charsets.
	(__gg__field_from_string): Charsets.
	(__gg__memdup): Charsets.
	* posix/bin/Makefile: Posix bindings.
	* posix/bin/scrape.awk: Posix bindings.
	* posix/bin/udf-gen: Posix bindings.
	* posix/udf/posix-lseek.cbl: Posix bindings.
	* posix/udf/posix-unlink.cbl: Posix bindings.
	* stringbin.cc (__gg__binary_to_string_encoded): Charsets.
	(__gg__numeric_display_to_binary): Charsets.
	* stringbin.h (__gg__binary_to_string_encoded): Charsets.
	* valconv.cc (__gg__string_to_numeric_edited): Charsets.
	* posix/cpy/psx-lseek.cpy: New file.
	* posix/shim/lseek.cc: New file.

gcc/testsuite/ChangeLog:

	* cobol.dg/group2/CHAR_and_ORD_with_COLLATING_sequence_-_EBCDIC.cob:
	Change diagnostics message.
	* cobol.dg/group2/Multi-target_MOVE_with_subscript_re-evaluation.cob:
	Change diagnostics message.
	* cobol.dg/group2/floating-point_SUBTRACT_FORMAT_2.out:
	Change diagnostics message.
	* cobol.dg/group2/floating-point_literals.out:
	Change diagnostics message.
2026-01-16 22:09:57 -05:00
Jakub Jelinek
c715060dd6 Update Copyright year in ChangeLog files
2025 -> 2026
2026-01-01 18:58:28 +01:00
GCC Administrator
019d7b6672 Daily bump. 2025-12-30 00:16:33 +00:00
Rainer Orth
1bcba38291 build: Cherry-pick libtool.m4 support for GNU ld *_sol2 emulations
GNU ld gained separate Solaris-specific linker emulations (*_sol2) long
ago.  Since their introduction, GCC has preferred them over their
non-*_sol2 counterparts but supported both forms.  This has changed for
GCC 16: since all supported versions of GNU ld do support the *_sol2
emulations, GCC now uses them unconditionally.

libtool has also been updated to handle this since libtool 2.4.2 back in
2011.  However, that change has only partially been backported to the
heavily patched libtool.m4 in the GCC tree: the sparcv9 part is there,
but the amd64 part is missing for some reason.  This causes problems
with some recent binutils changes.

Therefore this patch cherry-picks the libtool patch to bring
Solaris/x86_64 in sync with Solaris/sparcv9 and upstream libtool.

Bootstrapped without regressions on {amd64,i386}-pc-solaris2.11 and
{sparcv9,sparc}-sun-solaris2.11.

2025-09-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* libtool.m4: Cherry-pick libtool commit
	9196966580f6853a31187a7a3c7e7ff36ef08982.

	gcc:
	* configure: Regenerate.

	libatomic:
	* configure: Regenerate.

	libbacktrace:
	* configure: Regenerate.

	libcc1:
	* configure: Regenerate.

	libffi:
	* configure: Regenerate.

	libga68:
	* configure: Regenerate.

	libgcobol:
	* configure: Regenerate.

	libgfortran:
	* configure: Regenerate.

	libgm2:
	* configure: Regenerate.

	libgomp:
	* configure: Regenerate.

	libgrust:
	* configure: Regenerate.

	libitm:
	* configure: Regenerate.

	libobjc:
	* configure: Regenerate.

	libphobos:
	* configure: Regenerate.

	libquadmath:
	* configure: Regenerate.

	libsanitizer:
	* configure: Regenerate.

	libssp:
	* configure: Regenerate.

	libstdc++-v3:
	* configure: Regenerate.

	libvtv:
	* configure: Regenerate.

	lto-plugin:
	* configure: Regenerate.

	zlib:
	* configure: Regenerate.
2025-12-29 12:09:35 +01:00
GCC Administrator
5d70604b74 Daily bump. 2025-11-30 00:16:27 +00:00
Richard Biener
bd098c34be Bump libgcobol SONAME
This bumps the libgcobol SONAME for GCC 16 since compared to GCC 15
there are removed symbols and key data structures have changed.

	PR cobol/122803
libgcobol/
	* configure.ac (LIBGCOBOL_VERSION): Bump to 2:0:0.
	* configure: Re-generate.
2025-11-29 12:28:21 +01:00
GCC Administrator
608420810f Daily bump. 2025-11-19 00:19:58 +00:00
James K. Lowden
c48c6c0a50 cobol: Correct Makefile.am from 809b32660990867052132c706a9c9fdef1766e8f
Update lagging libgcobol/Makefile.am to match libgcobol/Makefile.in.

libgcobol/ChangeLog:
	PR cobol/122702
	* Makefile.am: Include posix/udf/posix-open.cbl.
2025-11-18 13:10:03 -05:00
GCC Administrator
0aac01bfa6 Daily bump. 2025-11-18 00:21:51 +00:00
James K. Lowden
d8e3ddc319 cobol: Correct libgcobol install directory and add components.
Set libgcobol/Makefile.am to define libdir and libsubdir the way libada does.
Reorganize libgcobol/compat directory to group by emulation, not component.
Move orphan gcc/udf/stored-char-length.cbl to the compat directory.
Introduce new POSIX bindings.

gcc/cobol/ChangeLog:
	PR cobol/122702
	* Make-lang.in: Move stored-char-length.cbl to libgcobol.

libgcobol/ChangeLog:
	PR cobol/122702
	* Makefile.am: Set libdir and libsubdir per libada example.
	* Makefile.in: Regenerate.
	* compat/README.md: Revise per new directory structure.
	* compat/gnu/lib/CBL_ALLOC_MEM.cbl: Moved from compat/lib/gnu.
	* compat/gnu/lib/CBL_CHECK_FILE_EXIST.cbl: Moved from compat/lib/gnu.
	* compat/gnu/lib/CBL_DELETE_FILE.cbl: Moved from compat/lib/gnu.
	* compat/gnu/lib/CBL_FREE_MEM.cbl: Moved from compat/lib/gnu.
	* compat/gnu/udf/stored-char-length.cbl: New file.
	* compat/lib/gnu/CBL_ALLOC_MEM.cbl: Moved to compat/gnu/lib.
	* compat/lib/gnu/CBL_CHECK_FILE_EXIST.cbl: Moved to compat/gnu/lib.
	* compat/lib/gnu/CBL_DELETE_FILE.cbl: Moved to compat/gnu/lib.
	* compat/lib/gnu/CBL_FREE_MEM.cbl: Moved to compat/gnu/lib.
	* posix/cpy/psx-open.cpy: New file.
	* posix/shim/open.cc: New file.
	* posix/shim/stat.h: Add mode & flag bits for open.cc
	* posix/udf/posix-lseek.cbl: New file.
	* posix/udf/posix-open.cbl: New file.
	* posix/udf/posix-read.cbl: New file.
	* posix/udf/posix-write.cbl: New file.
	* xmlparse.cc: Quell context_t initialization-order warning.
2025-11-17 18:25:50 -05:00
GCC Administrator
890dff609d Daily bump. 2025-11-14 00:20:34 +00:00
James K. Lowden
08e9df2546 cobol: Introduce vendor-compatibility layer as user-defined functions.
Install COBOL UDFs in a target directory that includes the GCC version
in its path, to permit side-by-side installation. Support compat
library with COBOL POSIX bindings; support those binding with C
functions in libgcobol as needed.

Changes to the compiler to support POSIX binding and testing.

Include developer conveniences -- Makefiles, bin/ and t/ directories --
to ensure UDFs compile and return reasonable results.  These are
not installed and do not affect how libgcobol is built.

gcc/cobol/ChangeLog:

	* cdf.y: Install literals in symbol table.
	* genapi.cc (parser_alphabet): Use std::string for currency.
	(initialize_the_data): Rely on constructor.
	(parser_file_add): Better #pragma message.
	(parser_exception_file): Return early if not generating code.
	* parse.y: Allow library programs to act as functions.
	* parse_ante.h (dialect_proscribed): Standardize message.
	(intrinsic_call_2): Correct s/fund/func/ misspelling.
	* scan.l: Comment.
	* symbols.cc (symbols_update): Add unreachable assertion.
	(symbol_field_parent_set): Reduce error to debug message.
	(cdf_literalize): Declare.
	(symbol_table_init): Insert CDF constants as literals.
	* symbols.h (cbl_dialect_str): Provide string values for enum.
	(is_working_storage): Remove function.
	(struct cbl_field_data_t): Add manhandle_initial for Numeric Edited.
	(struct cbl_field_t): Initialize name to zeros.
	(struct cbl_section_t): Delete unused attr() function.
	(symbol_unique_index): Declare.
	* token_names.h: Regenerate.
	* util.cc (cdf_literalize): Construct a cbl_field_t from a CDF literal.
	(symbol_unique_index): Supply "globally" unique number for a program.

libgcobol/ChangeLog:

	* Makefile.am: Move UDF-support to posix/shim, add install targets
	* Makefile.in: Regenerate
	* charmaps.cc (__gg__currency_signs): Use std::string.
	* charmaps.h: Include string and vector headers.
	(class charmap_t): Use std::string and vector for currency.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Check for libxml2.
	* intrinsic.cc (numval_c): Constify.
	* libgcobol.cc (struct program_state): Use std::string and vector.
	(__gg__inspect_format_2): Add debug messages.
	* libgcobol.h (__gg__get_default_currency_string): Constify.
	* valconv.cc (expand_picture): Use std::string and vector.
	(__gg__string_to_numeric_edited): Use std::string and vector.
	(__gg__currency_sign_init): Use std::string and vector.
	(__gg__currency_sign): Use std::string and vector.
	* xmlparse.cc (xml_push_parse): Reformat.
	* posix/stat.cc: Removed.
	* posix/stat.h: Removed.
	* .gitignore: New file.
	* compat/README.md: New file.
	* compat/lib/gnu/CBL_ALLOC_MEM.cbl: New file.
	* compat/lib/gnu/CBL_CHECK_FILE_EXIST.cbl: New file.
	* compat/lib/gnu/CBL_DELETE_FILE.cbl: New file.
	* compat/lib/gnu/CBL_FREE_MEM.cbl: New file.
	* compat/t/Makefile: New file.
	* compat/t/smoke.cbl: New file.
	* posix/README.md: New file.
	* posix/bin/Makefile: New file for UDF-developer.
	* posix/bin/headers: New file.
	* posix/bin/scrape.awk: New file.
	* posix/bin/sizeofs.c: New file.
	* posix/bin/udf-gen: New file.
	* posix/cpy/posix-errno.cbl: New file.
	* posix/cpy/statbuf.cpy: New file.
	* posix/cpy/tm.cpy: New file.
	* posix/errno.cc: Removed.
	* posix/localtime.cc: Removed.
	* posix/shim/stat.cc: New file.
	* posix/shim/stat.h: New file.
	* posix/t/Makefile: New file.
	* posix/t/errno.cbl: New file.
	* posix/t/exit.cbl: New file.
	* posix/t/localtime.cbl: New file.
	* posix/t/stat.cbl: New file.
	* posix/tm.h: Removed.
	* posix/udf/posix-exit.cbl: New file.
	* posix/udf/posix-localtime.cbl: New file.
	* posix/udf/posix-mkdir.cbl: New file.
	* posix/udf/posix-stat.cbl: New file.
	* posix/udf/posix-unlink.cbl: New file.
2025-11-12 19:49:39 -05:00
GCC Administrator
29ea6d141e Daily bump. 2025-11-07 00:20:18 +00:00
Robert Dubner
1139d69306 cobol: Mainly extends compilation and execution in finternal-ebcdic.
We expanded our extended testing regime to execute many testcases in
EBCDIC mode as well as in ASCII. This exposed hundreds of problems in
both compilation (where conversions must be made between the ASCII
source code and the EBCDIC execution environment) and in run-time
functionality, where results from calls to system routines and internal
calculations that must be done in ASCII have to be converted to EBCDIC.

These changes also switch to using FIXED_WIDE_INT(128) instead of
REAL_VALUE_TYPE when initializing fixed-point COBOL variable types.
This provides for accurate initialization up to 37 digits, instead of
losing accuracy after 33 digits.

These changes also support the implementation of the COBOL DELETE FILE
(Format 2) statement.

These changes also introduce expanded support for specifying character
encodings, including support for locales.

co-authored-by: Robert Dubner <rdubner@symas.com>
co-authored-by: James K. Lowden <jklowden@cobolworx.com>

gcc/cobol/ChangeLog:

	* Make-lang.in: Repair documentation generation.
	* cdf.y: Changes to tokens.
	* cobol1.cc (cobol_langhook_handle_option): Add comment.
	* genapi.cc (function_pointer_from_name): Use data.original() for
	function name.
	(parser_initialize_programs): Likewise.
	(cobol_compare): Make sure encodings of comparands are the same.
	(move_tree): Change name of DEFAULT_SOURCE_ENCODING macro.
	(parser_enter_program): Typo.
	(psa_FldLiteralN): Break out dirty_to_binary() support routine.
	(dirty_to_binary): Likewise.
	(parser_alphabet): Rename 'alphabet' to 'collation_sequence'.
	(parser_allocate): Change wsclear() to be uint32_t instead of char.
	(parser_label_label): Formatting.
	(parser_label_goto): Likewise.
	(get_the_filename): Breakout get_the_filename(), which handles
	encoding.
	(parser_file_open): Likewise.
	(set_up_delete_file_label): Implement DELETE FILE (Format 2).
	(parser_file_delete_file): Likewise.
	(parser_file_delete_on_exception): Likewise.
	(parser_file_delete_not_exception): Likewise.
	(parser_file_delete_end): Likewise.
	(parser_call): Use data.original().
	(parser_entry): Use data.original().
	(mh_source_is_literalN): Convert from
	sourceref.field->codeset.encoding.
	(binary_initial_from_float128): Change to "binary_initial".
	(binary_initial): Calculate in FIXED_WIDE_INT(128) instead of
	REAL_VALUE_TYPE.
	(digits_from_int128): New routine uses binary_initial.
	(digits_from_float128): Removed.  Kept as comment for reference.
	(initial_from_initial): Use binary_initial.
	(actually_create_the_static_field): Use correct encoding.
	(parser_symbol_add): Likewise.
	* genapi.h (parser_file_delete_file): Implement FILE DELETE.
	(parser_file_delete_on_exception): Implement FILE DELETE.
	(parser_file_delete_not_exception): Implement FILE DELETE.
	(parser_file_delete_end): Implement FILE DELETE.
	* genmath.cc: Include charmaps.h.
	* genutil.cc (get_literal_string):  Change name of
	DEFAULT_SOURCE_ENCODING macro.
	* parse.y: Token changes; numerous changes in support of encoding;
	support for DELETE FILE.
	* parse_ante.h (name_of): Use data.original().
	(class prog_descr_t): Support of locales.
	(current_options): Formatting.
	(current_encoding):  Formatting.
	(current_program_index): Formatting.
	(current_section): Formatting.
	(current_paragraph): Formatting.
	(is_integer_literal): Use correct encoding.
	(value_encoding_check): Handle encoding changes.
	(alphabet_add): Likewise.
	(data_division_ready): Likewise.
	* scan.l: Use data.original().
	* show_parse.h: Use correct encoding.
	* symbols.cc (elementize): Likewise.
	(symbol_elem_cmp): Handle locale.
	(struct symbol_elem_t): Likewise.
	(symbol_locale): Likewise.
	(field_str): Change DEFAULT_SOURCE_ENCODING macro name.
	(symbols_alphabet_set): Formatting.
	(symbols_update): Modify consistency checks.
	(symbol_locale_add): Locale support.
	(cbl_locale_t::cbl_locale_t): Locale support.
	(cbl_alphabet_t::cbl_alphabet_t): New structure.
	(cbl_alphabet_t::reencode): Formatting.
	(cbl_alphabet_t::assign): Change name of collation_sequence.
	(cbl_alphabet_t::also): Likewise.
	(new_literal_add): Anticipate the need for four-byte characters.
	(guess_encoding): Eliminate.
	(cbl_field_t::internalize): Refine conversion of data.initial to
	specified encoding.
	* symbols.h (enum symbol_type_t): Add SymLocale.
	(struct cbl_field_data_t): Incorporate data.orig.
	(struct cbl_field_t): Likewise.
	(struct cbl_delete_file_t): New structure.
	(struct cbl_label_t): Incorporate cbl_delete_file_t.
	(struct cbl_locale_t): Support for locale.
	(hex_decode): Comment.
	(struct cbl_alphabet_t): Incorporate locale; change variable name
	to collation_sequence.
	(struct symbol_elem_t): Incorporate locale.
	(cbl_locale_of): Likewise.
	(cbl_alphabet_of): Likewise.
	(symbol_locale_add): Likewise.
	(wsclear): Type is now uint32_t instead of char.
	* util.cc (symbol_type_str):  Incorporate locale.
	(cbl_field_t::report_invalid_initial_value): Change test so that
	pure PIC A() variables are limited to [a-zA-Z] and space.
	(valid_move): Use DEFAULT_SOURCE_ENCODING macro.
	(cobol_filename): Formatting.

libgcobol/ChangeLog:

	* charmaps.cc (__gg__encoding_iconv_type): Eliminate trailing
	'/' characters from encoding names.
	(__gg__get_charmap): Switch to DEFAULT_SOURCE_ENCODING macro name.
	* charmaps.h (DEFAULT_CHARMAP_SOURCE): Likewise.
	(DEFAULT_SOURCE_ENCODING): Likewise.
	(class charmap_t): Enhance constructor.
	* encodings.h (valid_encoding): New routine.
	* gcobolio.h (enum cblc_file_prior_op_t): Support DELETE FILE.
	* gfileio.cc (get_filename): Likewise.
	(__io__file_remove): Likewise.
	(__gg__file_reopen): Likewise.
	(__io__file_open): Likewise.
	(gcobol_fileops): Likewise.
	(__gg__file_delete): Likewise.
	(__gg__file_remove): Likewise.
	* intrinsic.cc (get_all_time):  Switch to DEFAULT_SOURCE_ENCODING
	macro name.
	(ftime_replace): Support ASCII/EBCDIC encoding.
	(__gg__current_date): Likewise.
	(__gg__max): Likewise.
	(__gg__lower_case): Likewise.
	(numval): Likewise.
	(numval_c): Likewise.
	(__gg__upper_case): Likewise.
	(__gg__when_compiled): Likewise.
	(gets_int): Likewise.
	(gets_nanoseconds): Likewise.
	(fill_cobol_tm): Likewise.
	(floating_format_tester): Likewise.
	(__gg__numval_f): Likewise.
	(__gg__test_numval_f): Likewise.
	(iscasematch): Likewise.
	(strcasestr): Likewise.
	(strcaselaststr): Likewise.
	(__gg__substitute): Likewise.
	(__gg__locale_compare): Support for locale.
	(__gg__locale_date): Likewise.
	(__gg__locale_time): Likewise.
	(__gg__locale_time_from_seconds): Likewise.
	* libgcobol.cc (class ec_status_t): Support for encoding.
	(int128_to_field): Likewise.
	(__gg__dirty_to_float): Likewise.
	(format_for_display_internal): Likewise.
	(get_float128): Likewise.
	(compare_field_class): Likewise.
	(__gg__compare_2): Likewise.
	(init_var_both): Likewise.
	(__gg__move): Likewise.
	(display_both): Likewise.
	(is_numeric_display_numeric): Likewise.
	(accept_envar): Likewise.
	(__gg__get_argv): Likewise.
	(__gg__unstring): Likewise.
	(__gg__check_fatal_exception): Likewise.
	(__gg__adjust_encoding): Likewise.
	(__gg__func_exception_location): Likewise.
	(__gg__func_exception_statement): Likewise.
	(__gg__func_exception_status): Likewise.
	(__gg__func_exception_file): Likewise.
	(__gg__just_mangle_name): Likewise.
	(__gg__function_handle_from_name): Likewise.
	(get_the_byte): Likewise.
	(__gg__module_name): Likewise.
	(__gg__accept_arg_value): Likewise.
	* xmlparse.cc (fatalError): Formatting.
	(setDocumentLocator): Formatting.
	(xmlchar_of): Formatting.
	(xmlParserErrors_str): Formatting.
2025-11-06 08:57:54 -05:00
GCC Administrator
0e9ccae269 Daily bump. 2025-11-04 00:20:26 +00:00
Sam James
f8bb20167f gcc: sync top-level with binutils-gdb
This just pulls in Alan's:

commit 87b6078fc212ccba5f043399c6370ee20f6b355a
Author:     Alan Modra <amodra@gmail.com>
AuthorDate: Mon Nov 3 10:59:50 2025 +1030
Commit:     Alan Modra <amodra@gmail.com>
CommitDate: Mon Nov 3 10:59:50 2025 +1030

    tidy m4 plugin config support

    ...

It tidies up the configure test output.

config/ChangeLog:

	* clang-plugin.m4: Sync with binutils.
	* gcc-plugin.m4: Ditto.

ChangeLog:

	* configure: Regenerate.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgcobol/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgm2/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libgrust/ChangeLog:

	* configure: Regenerate.

libiberty/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.

zlib/ChangeLog:

	* configure: Regenerate.
2025-11-03 20:25:00 +00:00
GCC Administrator
4d26a60894 Daily bump. 2025-10-29 00:19:49 +00:00
Sam James
71233d3170 libgcobol: fix xmlCtxtGetVersion typo again
Followup to r16-4668-g374ec67294fc4f. I'd assumed the build got past
this point but it turned out it hadn't.

libgcobol/ChangeLog:
	PR cobol/122451

	* xmlparse.cc (context_t): Make 'ctxt' public.
	(xml_push_parse): Fix xmlCtxtGetVersion argument.
2025-10-28 01:20:13 +00:00
GCC Administrator
3d09cd9311 Daily bump. 2025-10-28 00:21:54 +00:00
Sam James
374ec67294 libgcobol: fix xmlCtxtGetVersion typo
libgcobol/ChangeLog:
	PR cobol/122451

	* xmlparse.cc (xml_push_parse): Fix xmlCtxtGetVersion argument
	typo to be 'context'.
2025-10-27 22:54:53 +00:00
James K. Lowden
89a6db7bbe Various fixes for XML PARSE.
Annotate unused parameters.  Do not compile some functions that might
not be needed.  Consistent with libgcobol, log errors via syslog(3).
Introduce push-parser as experiment.

libgcobol/ChangeLog: Correct warnings and errors in xmlparse.cc.

	* xmlparse.cc (CTX): Macro for unused user-context parameter.
	(attributeDecl): Mark unused parameters.
	(cdataBlock): Same.
	(characters): Same.
	(comment): Same.
	(elementDecl): Same.
	(endDocument): Same.
	(endElementNs): Same.
	(endElement): Same.
	(entityDecl): Same.
	(error): Same.
	(externalSubset): Same.
	(fatalError): Same.
	(getEntity): Eliminate via preprocessor until needed.
	(getParameterEntity): Same.
	(hasExternalSubset): Mark unused parameters.
	(hasInternalSubset): Same.
	(ignorableWhitespace): Same.
	(internalSubset): Same.
	(isStandalone): Eliminate via preprocessor until needed.
	(notationDecl): Mark unused parameters.
	(processingInstruction): Same.
	(reference): Same.
	(resolveEntity): Eliminate via preprocessor until needed.
	(setDocumentLocator): Mark unused parameters.
	(startDocument): Same.
	(startElementNs): Same.
	(startElement): Same.
	(unparsedEntityDecl): Same.
	(warning): Same.
	(xmlchar_of): Utility cast function.
	(xmlParserErrors_str): Message string for libxml2 errors.
	(xmlerror_str): Macro to include textual form of libxml2 error.
	(context_t): Push-parser context class.
	(xml_push_parse): Use push-parser.
	(__gg__xml_parse_done): Signify end-of-input to XML push-parser.
	(__gg__xml_parse): Mark unused parameters.
2025-10-27 13:36:10 -04:00
GCC Administrator
fa44dc4939 Daily bump. 2025-10-26 00:17:33 +00:00
Sam James
c1b9b3812d libgcobol: fix compat w/ >=libxml2-2.12
libgcobol/ChangeLog:
	PR cobol/122398

	* xmlparse.cc (__gg__xml_parse): Make 'msg' const.
2025-10-25 22:02:48 +01:00
GCC Administrator
5abeecf68e Daily bump. 2025-10-24 00:19:11 +00:00
Robert Dubner
e9757133bb cobol: Corrected FUNCTION CHAR and FUNCTION ORD.
The functions CHAR and ORD have been changed to correctly report on
character positions within the collation sequence.

The use of the LOW-VALUE and HIGH-VALUE figurative constants has been
corrected.

Some establishment of DISPLAY and NATIONAL encodings has been done
in anticipation of changes soon to come.

Some new testsuite tests have been added.

gcc/cobol/ChangeLog:

	* genapi.cc (parser_alphabet): Alphabet encoding.
	(parser_alphabet_use): Likewise.
	(parser_xml_parse): Use correct debugging macro; encoding.
	(parser_xml_on_exception): Likewise.
	(parser_xml_not_exception): Likewise.
	(parser_xml_end): Likewise.
	(initialize_the_data): Encoding.
	(parser_label_label): Debugging macros.
	(parser_label_goto): Likewise.
	(parser_file_add): Encoding.
	(parser_intrinsic_call_1): Special handling for __gg__char.
	(parser_intrinsic_call_2): Formatting.
	* parse.y: Response from FUNCTION ORD is flagged "unsigned".
	* symbols.cc (cbl_alphabet_t::reencode): Establish
	low_char & high_char.
	* symbols.h (struct cbl_alphabet_t): Likewise.

libgcobol/ChangeLog:

	* charmaps.cc: Encoding.
	* charmaps.h (class charmap_t): Encoding.
	* intrinsic.cc (__gg__char): Report the character at the
	collation position.
	(__gg__ord): Report the collation position of a character.
	* libgcobol.cc (struct program_state): Add encodings;
	Remove obsolete defines.
	(__gg__current_collation): New function for encoding/collation.
	(__gg__pop_program_state): Encoding.
	(__gg__init_program_state): Encoding.
	(format_for_display_internal): Handle LOW-VALUE and HIGH-VALUE.
	(__gg__compare_2): Encoding.
	(__gg__alphabet_use): Likewise.
	* libgcobol.h (__gg__current_collation): New declaration.
	* xmlparse.cc (__gg__xml_parse): Make a parameter const.

gcc/testsuite/ChangeLog:

	* cobol.dg/group2/Length_overflow__2_.out: Updated test result.
	* cobol.dg/group2/Length_overflow_with_offset__1_.out: Likewise.
	* cobol.dg/group2/Offset_overflow.out: Likewise.
	* cobol.dg/group2/CALL_with_OCCURS_DEPENDING_ON.cob: New test.
	* cobol.dg/group2/CALL_with_OCCURS_DEPENDING_ON.out: New test.
	* cobol.dg/group2/CHAR_and_ORD_with_COLLATING_sequence_-_ASCII.cob: New test.
	* cobol.dg/group2/CHAR_and_ORD_with_COLLATING_sequence_-_ASCII.out: New test.
	* cobol.dg/group2/CHAR_and_ORD_with_COLLATING_sequence_-_EBCDIC.cob: New test.
	* cobol.dg/group2/CHAR_and_ORD_with_COLLATING_sequence_-_EBCDIC.out: New test.
	* cobol.dg/group2/EC-BOUND-REF-MOD_checking_process_termination.cob: New test.
	* cobol.dg/group2/EC-BOUND-REF-MOD_checking_process_termination.out: New test.
	* cobol.dg/group2/Intrinsics_without_FUNCTION_keyword__3_.cob: New test.
	* cobol.dg/group2/Occurs_DEPENDING_ON__source_and_dest.cob: New test.
	* cobol.dg/group2/Occurs_DEPENDING_ON__source_and_dest.out: New test.
	* cobol.dg/group2/Recursive_subscripts.cob: New test.
	* cobol.dg/group2/Recursive_subscripts.out: New test.
	* cobol.dg/group2/SEARCH_ALL_with_OCCURS_DEPENDING_ON.cob: New test.
	* cobol.dg/group2/SEARCH_ALL_with_OCCURS_DEPENDING_ON.out: New test.
	* cobol.dg/group2/Subscript_by_arithmetic_expression.cob: New test.
	* cobol.dg/group2/Subscript_out_of_bounds__1_.cob: New test.
	* cobol.dg/group2/Subscript_out_of_bounds__1_.out: New test.
	* cobol.dg/group2/Subscript_out_of_bounds__2_.cob: New test.
	* cobol.dg/group2/Subscript_out_of_bounds__2_.out: New test.
	* cobol.dg/group2/Subscripted_refmods.cob: New test.
	* cobol.dg/group2/Subscripted_refmods.out: New test.
	* cobol.dg/group2/length_of_ODO_Rules_7__8A__and_8B.cob: New test.
	* cobol.dg/group2/length_of_ODO_Rules_7__8A__and_8B.out: New test.
	* cobol.dg/group2/length_of_ODO_w_-_reference_modification.cob: New test.
2025-10-23 14:51:16 -04:00
Robert Dubner
b20c6458fa cobol: Implement the XML PARSE statement.
These changes implement the XML PARSE statement as described in the IBM
specification.

A repair to exception handling is included.  Up until now, an exception
after a successful file operation wasn't handled properly.

A repair to value declarations for BINARY / COMP / COMP-4 / COMP-5
values now allows them to have digits to the right of the implied
decimal point.  Processing of the "S" PICTURE character has been
normalized as well.

Co-Authored-By: James K. Lowden <jklowden@cobolworx.com>
Co-Authored-By: Robert Dubner <rdubner@symas.com>

gcc/cobol/ChangeLog:

	* Make-lang.in: Incorporate new token_names.h file.
	* cdf.y: Modify tokens.
	* gcobol.1: Document XML PARSE statement
	* genapi.cc (parser_enter_program): Verify that every goto has a
	matching label.
	(parser_end_program): Likewise.
	(parser_alphabet): Refine handling codeset encodings.
	(parser_alphabet_use): Likewise.
	(label_fetch): Moved from later in the source code.
	(parser_xml_parse): New routine for XML PARSE.
	(parser_xml_on_exception): Likewise.
	(parser_xml_not_exception): Likewise.
	(parser_xml_end): Likewise.
	(parser_label_label): Verify goto/label matching.
	(parser_label_goto): Likewise.
	(parser_entry): Minor change to SHOW_PARSE report.
	* genapi.h (parser_alphabet): Set parameter to const.
	(parser_xml_parse): Declare new function.
	(parser_xml_on_exception): Likewise.
	(parser_xml_not_exception): Likewise.
	(parser_xml_end): Likewise.
	(parser_label_addr): Likewise.
	* parse.y: label_pair_t structure; locale processing; new token
	processing for alphabets and XML PARSE.
	* parse_ante.h (name_of): Return field->name when initial is NULL.
	(new_tempnumeric): Make signable_e optional.
	(ast_save_locale): New function.
	(data_division_ready): Warning for "no alphabet".
	* scan.l: Repair interpretation of BINARY, COMP, COMP-4, and
	COMP-5.
	* scan_ante.h (struct bint_t): Likewise.
	* scan_post.h (current_tokens_t::tokenset_t::tokenset_t):
	Include token_names.h.
	* symbols.cc (symbols_alphabet_set): Revert to prior alphabet
	determination.
	(symbol_table_init): New XML special registers.
	(new_temporary): Make signable_e controllable, not fixed.
	* symbols.h (__gg__encoding_iconv_valid): New declaration.
	(enum cbl_label_type_t): New LblXml label type.
	(struct cbl_xml_parse_t):
	(struct cbl_label_t): Implement XML PARSE.
	(new_temporary): Incorporate boolean for signable_e.
	(symbol_elem_of): Change label field type handling.
	(cbl_section_of): Likewise.
	(cbl_field_of): Likewise.
	(cbl_label_of): Likewise.
	(cbl_special_name_of):  Likewise.
	(cbl_alphabet_of):  Likewise.
	(cbl_file_of):  Likewise.
	* token_names.h: New file.
	* util.cc (gcc_location_set_impl): Improve location_t calculations
	when entering and leaving COPYBOOKs.

libgcobol/ChangeLog:

	* Makefile.am: Changes for XML PARSE and POSIX functions.
	* Makefile.in: Likewise.
	* charmaps.cc: Augment encodings[] table with "supported" boolean.
	(__gg__encoding_iconv_name): Modify how encodings are identified.
	(encoding_descr): Likewise.
	(__gg__encoding_iconv_valid): Likewise.
	* common-defs.h (callback_t): Define function pointer.
	* constants.cc: Use named cbl_attr_e constants instead of magic
	numbers.; New definitions for XML special registers.
	* encodings.h (struct encodings_t): Declare "supported" boolean.
	* libgcobol.cc (format_for_display_internal): Use std::ptrdiff_t.
	(__gg__alphabet_use): Add case for iconv_CP1252_e.
	(default_exception_handler): Repair exception handling after a
	successful file operation.
	* posix/errno.cc: New file.
	* posix/localtime.cc: New file.
	* posix/stat.cc: New file.
	* posix/stat.h: New file.
	* posix/tm.h: New file.
	* xmlparse.cc: New file to support XML PARSE statement.

gcc/testsuite/ChangeLog:

	* cobol.dg/typo-1.cob: New test for squiggles and carets.
2025-10-23 11:28:53 -04:00
GCC Administrator
1d8272d4d8 Daily bump. 2025-10-20 00:18:13 +00:00
Robert Dubner
85750fb8c2 cobol: Implement ENTRY statement; finish removing ascii/ebcdic dichotomy.
The prior set of changes largely eliminated the assumption that the
internal codeset was either ascii or ebcdic.  These changes remove the
last vestiges of that assumption.

These changes also implement the COBOL ENTRY statement, which allows a
program-id to have more than one externally callable entry point. Since
GCC assumes the existence of an ABI that is not, repeat *not* capable of
that, it is implemented here by creating a separate function with the
name specified by the ENTRY statement.  That function sets up global
variables which cause control to be transferred to the ENTRY point when
the parent function is called re-entrantly, and then executes that call.

gcc/cobol/ChangeLog:

	* genapi.cc (move_tree): Formatting.
	(parser_enter_file): Incorporate global __gg__entry_label.
	(enter_program_common): Remove calls to alphabet overrides.
	(parser_alphabet): Change cbl_alphabet_e handling.
	(parser_alphabet_use): Likewise.
	(initialize_the_data): Likewise.
	(establish_using): Process passed parameters in a subroutine.
	(parser_division): Remove in-line parameter processing;
	call establish_using() instead. Check for __gg__entry_label.
	(parser_file_add): Temporary workaround for charset encoding.
	(parser_file_open): Likewise.
	(create_and_call): Push/pop program state around call to external.
	(parser_entry): Implement new ENTRY statement feature.
	(mh_source_is_literalN): Formatting.
	* genapi.h (parser_entry): New ENTRY statement.
	* gengen.cc (gg_create_goto_pair): Formatting.
	(gg_goto_label_decl): Remove.
	* gengen.h (gg_goto_label_decl): Remove.
	* genutil.cc (internal_codeset_is_ebcdic): Remove.
	* genutil.h (internal_codeset_is_ebcdic): Remove.
	* symbols.cc (symbols_alphabet_set): Restrict alphabet scan to
	program.
	* symbols.h (is_elementary): Use defined constants instead of
	explicit 'A'and 'N'

libgcobol/ChangeLog:

	* charmaps.cc (__gg__set_internal_codeset): Eliminate ascii/ebcdic.
	(__gg__text_conversion_override): Remove.
	* charmaps.h (enum text_device_t):  Eliminate ascii/ebcdic.
	(enum text_codeset_t): Remove.
	(__gg__set_internal_codeset): Remove.
	(__gg__text_conversion_override): Remove.
	* gfileio.cc: Anticipate cbl_encoding_t fixes.
	* libgcobol.cc (struct program_state): Incorporate
	__gg__entry_label.
	(__gg__pop_program_state): Eliminate unused defines.
	(__gg__alphabet_use): Eliminate ascii/ebcdic dichotomy.
	* valconv.cc (__gg__alphabet_create): Likewise.
2025-10-18 20:49:21 -04:00
GCC Administrator
ddd6dff0ba Daily bump. 2025-10-11 00:21:09 +00:00
Robert Dubner
0e95ebf465 cobol: Convert to individual variable character-set encoding.
Prior to this "patch", the GCOBOL compiler was capable of producing binaries
that operated internally in either ASCII or EBCDIC.  The COBOL specification,
however, allows for the concurrent presence of two encodings, known as
"alphanumeric" and "national".

In order to support this capability, we have chosen to establish an "encoding"
characteristic that gets carried along with every variable,

This change affected many parts of the COBOL front end compiler.  If anybody
looks at any of the changes listed below, they will find they fall into two
classes:

1) Removing the dependence on a global ASCII vs EBCDIC determination.

2) Adding a dependence on a new ::encoding characteristic of the compile time
and run time cbl_field_t and cblc_field_t variable structures.  Those
structures now contain the cbl_encoding_t ::encoding members, which drive the
use of the iconv(3) function in moving back and forth between variable
encodings.

Although the effort is not complete, these changes represent the bulk of what
needs to be done.  With these changes in place, all of our current ASCII and
EBCDIC tests run properly.

gcc/cobol/ChangeLog:

	* cdf.y: In support of the described changes.
	* gcobol.1: Likewise.
	* genapi.cc (level_88_helper): Likewise.
	(get_level_88_domain): Likewise.
	(get_class_condition_string): Likewise.
	(initialize_variable_internal): Likewise.
	(gg_default_qualification): Likewise.
	(cobol_compare): Likewise.
	(move_tree): Likewise.
	(move_tree_to_field): Likewise.
	(psa_FldBlob): Likewise.
	(parser_accept_date_yymmdd): Likewise.
	(parser_accept_date_yyyymmdd): Likewise.
	(parser_accept_date_yyddd): Likewise.
	(parser_accept_date_yyyyddd): Likewise.
	(parser_accept_date_dow): Likewise.
	(parser_accept_date_hhmmssff): Likewise.
	(parser_alphabet): Likewise.
	(parser_alphabet_use): Likewise.
	(parser_display_internal): Likewise.
	(parser_display): Likewise.
	(is_valuable): Likewise.
	(parser_division): Likewise.
	(parser_relop_long): Likewise.
	(parser_setop): Likewise.
	(parser_set_conditional88): Likewise.
	(parser_file_add): Likewise.
	(parser_file_open): Likewise.
	(create_and_call): Likewise.
	(parser_call): Likewise.
	(mh_identical): Likewise.
	(mh_source_is_literalN): Likewise.
	(picky_memcpy): Likewise.
	(mh_numeric_display): Likewise.
	(mh_source_is_group): Likewise.
	(mh_source_is_literalA): Likewise.
	(move_helper): Likewise.
	(initial_from_initial): Likewise.
	(actually_create_the_static_field): Likewise.
	(psa_FldLiteralA): Likewise.
	(parser_symbol_add): Likewise.
	* genmath.cc (arithmetic_operation): Likewise.
	* genutil.cc (get_binary_value): Likewise.
	(get_literal_string): Likewise.
	* genutil.h (EBCDIC_MINUS): Likewise.
	(EBCDIC_PLUS): Likewise.
	(EBCDIC_ZERO): Likewise.
	(EBCDIC_NINE): Likewise.
	* parse.y: Likewise.
	* parse_ante.h (name_of): Likewise.
	(class prog_descr_t): Likewise.
	(current_encoding): Likewise.
	(needs_picture): Likewise.
	(is_callable): Likewise.
	(field_attr_str): Likewise.
	(value_encoding_check): Likewise.
	(field_alloc): Likewise.
	(file_add): Likewise.
	* scan.l: Likewise.
	* structs.cc (create_cblc_field_t): Likewise.
	* symbols.cc (elementize): Likewise.
	(cbl_field_attr_str): Likewise.
	(is_variable_length): Likewise.
	(field_str): Likewise.
	(extend_66_capacity): Likewise.
	(assert): Likewise.
	(symbols_update): Likewise.
	(symbol_field_parent_set): Likewise.
	(add_token): Likewise.
	(symbol_table_init): Likewise.
	(symbol_field_add): Likewise.
	(symbol_field_forward_add): Likewise.
	(symbol_field_same_as): Likewise.
	(cbl_alphabet_t::reencode): Likewise.
	(new_temporary_impl): Likewise.
	(parser_symbol_add2): Likewise.
	(new_literal_add): Likewise.
	(temporaries_t::literal): Likewise.
	(new_literal): Likewise.
	(standard_internal): Likewise.
	(new_temporary): Likewise.
	(cbl_field_t::holds_ascii): Likewise.
	(cbl_field_t::is_ascii): Likewise.
	(cbl_field_t::internalize): Likewise.
	(symbol_label_add): Likewise.
	(symbol_label_section_exists): Likewise.
	(cbl_occurs_t::subscript_ok): Likewise.
	(cbl_file_t::deforward): Likewise.
	(has_value): Likewise.
	* symbols.h (is_numeric): Likewise.
	(__gg__encoding_iconv_name): Likewise.
	(current_encoding): Likewise.
	(struct cbl_field_t): Likewise.
	(new_literal): Likewise.
	(class temporaries_t): Likewise.
	(struct function_descr_t): Likewise.
	(hex_decode): Likewise.
	(struct cbl_alphabet_t): Likewise.
	(struct cbl_file_t): Likewise.
	* symfind.cc (field_structure): Likewise.
	(erase_symbol_map_fwds): Likewise.
	(symbol_find): Likewise.
	* token_names.h: Likewise.
	* util.cc (cbl_field_type_str): Likewise.
	(is_elementary): Likewise.
	(symbol_field_type_update): Likewise.
	(cbl_field_t::report_invalid_initial_value): Likewise.
	(valid_move): Likewise.
	(valid_picture): Likewise.
	(type_capacity): Likewise.
	(gcc_location_set_impl): Likewise.
	(cbl_unimplementedw): Likewise.

libgcobol/ChangeLog:

	* charmaps.cc (raw_is_SBC): Likewise.
	(extract_next_code_point): Likewise.
	(flipper): Likewise.
	(__gg__ascii_to_ascii_chr): Likewise.
	(__gg__ascii_to_ebcdic_chr): Likewise.
	(__gg__raw_to_ascii): Likewise.
	(__gg__raw_to_ebcdic): Likewise.
	(convert_cp1252_to_utf8): Likewise.
	(__gg__text_conversion_override): Likewise.
	(__gg__ascii_to_ascii): Likewise.
	(__gg__encoding_iconv_name): Likewise.
	(__gg__encoding_iconv_type): Likewise.
	(__gg__ascii_to_ebcdic): Likewise.
	(__gg__iconverter): Likewise.
	(__gg__ebcdic_to_ascii): Likewise.
	(__gg__ascii_to_console): Likewise.
	(__gg__ebcdic_to_console): Likewise.
	(__gg__console_to_ascii): Likewise.
	(__gg__console_to_ebcdic): Likewise.
	(_to_ctype): Likewise.
	(_from_ctype): Likewise.
	(__gg__get_charmap): Likewise.
	* charmaps.h (internal_is_ebcdic): Likewise.
	(internal_space): Likewise.
	(internal_zero): Likewise.
	(internal_period): Likewise.
	(internal_comma): Likewise.
	(internal_dquote): Likewise.
	(internal_asterisk): Likewise.
	(internal_plus): Likewise.
	(internal_minus): Likewise.
	(internal_cr): Likewise.
	(internal_ff): Likewise.
	(internal_newline): Likewise.
	(internal_return): Likewise.
	(internal_0): Likewise.
	(internal_1): Likewise.
	(internal_2): Likewise.
	(internal_3): Likewise.
	(internal_4): Likewise.
	(internal_5): Likewise.
	(internal_6): Likewise.
	(internal_7): Likewise.
	(internal_8): Likewise.
	(internal_9): Likewise.
	(internal_colon): Likewise.
	(internal_query): Likewise.
	(internal_A): Likewise.
	(internal_B): Likewise.
	(internal_C): Likewise.
	(internal_D): Likewise.
	(internal_E): Likewise.
	(internal_F): Likewise.
	(internal_G): Likewise.
	(internal_H): Likewise.
	(internal_I): Likewise.
	(internal_J): Likewise.
	(internal_K): Likewise.
	(internal_L): Likewise.
	(internal_M): Likewise.
	(internal_N): Likewise.
	(internal_O): Likewise.
	(internal_P): Likewise.
	(internal_Q): Likewise.
	(internal_R): Likewise.
	(internal_S): Likewise.
	(internal_T): Likewise.
	(internal_U): Likewise.
	(internal_V): Likewise.
	(internal_W): Likewise.
	(internal_X): Likewise.
	(internal_Y): Likewise.
	(internal_Z): Likewise.
	(internal_a): Likewise.
	(internal_b): Likewise.
	(internal_c): Likewise.
	(internal_d): Likewise.
	(internal_e): Likewise.
	(internal_f): Likewise.
	(internal_g): Likewise.
	(internal_h): Likewise.
	(internal_i): Likewise.
	(internal_j): Likewise.
	(internal_k): Likewise.
	(internal_l): Likewise.
	(internal_m): Likewise.
	(internal_n): Likewise.
	(internal_o): Likewise.
	(internal_p): Likewise.
	(internal_q): Likewise.
	(internal_r): Likewise.
	(internal_s): Likewise.
	(internal_t): Likewise.
	(internal_u): Likewise.
	(internal_v): Likewise.
	(internal_w): Likewise.
	(internal_x): Likewise.
	(internal_y): Likewise.
	(internal_z): Likewise.
	(enum text_codeset_t): Likewise.
	(__gg__ascii_to_ascii_chr): Likewise.
	(__gg__ascii_to_ebcdic_chr): Likewise.
	(ascii_to_internal): Likewise.
	(__gg__ascii_to_ascii): Likewise.
	(__gg__ascii_to_ebcdic): Likewise.
	(ascii_to_internal_str): Likewise.
	(__gg__raw_to_ascii): Likewise.
	(__gg__raw_to_ebcdic): Likewise.
	(raw_to_internal): Likewise.
	(__gg__ascii_to_console): Likewise.
	(__gg__ebcdic_to_console): Likewise.
	(internal_to_console): Likewise.
	(__gg__console_to_ascii): Likewise.
	(__gg__console_to_ebcdic): Likewise.
	(console_to_internal): Likewise.
	(__gg__ebcdic_to_ascii): Likewise.
	(internal_to_ascii): Likewise.
	(__gg__encoding_iconv_name): Likewise.
	(__gg__encoding_iconv_type): Likewise.
	(__gg__iconverter): Likewise.
	(DEFAULT_CHARMAP_SOURCE): Likewise.
	(class charmap_t): Likewise.
	(__gg__get_charmap): Likewise.
	* common-defs.h (EBCDIC_MINUS): Likewise.
	(EBCDIC_PLUS): Likewise.
	(EBCDIC_ZERO): Likewise.
	(EBCDIC_NINE): Likewise.
	(PACKED_NYBBLE_PLUS): Likewise.
	(PACKED_NYBBLE_MINUS): Likewise.
	(PACKED_NYBBLE_UNSIGNED): Likewise.
	(NUMERIC_DISPLAY_SIGN_BIT_EBCDIC): Likewise.
	(NUMERIC_DISPLAY_SIGN_BIT): Likewise.
	(SEPARATE_PLUS): Likewise.
	(SEPARATE_MINUS): Likewise.
	(ZONED_ZERO): Likewise.
	(ZONE_SIGNED_EBCDIC): Likewise.
	(enum cbl_field_type_t): Likewise.
	(enum cbl_field_attr_t): Likewise.
	(enum cbl_figconst_t): Likewise.
	(enum cbl_encoding_t): Likewise.
	* constants.cc (struct cblc_field_t): Likewise.
	(X): Likewise.
	(S9): Likewise.
	* gcobolio.h: Likewise.
	* gfileio.cc (get_filename): Likewise.
	(relative_file_delete): Likewise.
	(relative_file_start): Likewise.
	(relative_file_rewrite): Likewise.
	(relative_file_write_varying): Likewise.
	(relative_file_write): Likewise.
	(sequential_file_write): Likewise.
	(line_sequential_file_read): Likewise.
	(sequential_file_read): Likewise.
	(relative_file_read): Likewise.
	(file_indexed_open): Likewise.
	(__gg__file_reopen): Likewise.
	(__io__file_open): Likewise.
	(__io__file_close): Likewise.
	(__gg__file_open): Likewise.
	* intrinsic.cc (trim_trailing_spaces): Likewise.
	(is_zulu_format): Likewise.
	(string_to_dest): Likewise.
	(get_all_time): Likewise.
	(ftime_replace): Likewise.
	(__gg__char): Likewise.
	(__gg__current_date): Likewise.
	(__gg__seconds_past_midnight): Likewise.
	(__gg__formatted_current_date): Likewise.
	(__gg__formatted_date): Likewise.
	(__gg__formatted_datetime): Likewise.
	(__gg__formatted_time): Likewise.
	(__gg__lower_case): Likewise.
	(numval): Likewise.
	(numval_c): Likewise.
	(__gg__ord): Likewise.
	(__gg__trim): Likewise.
	(__gg__random): Likewise.
	(__gg__random_next): Likewise.
	(__gg__reverse): Likewise.
	(__gg__upper_case): Likewise.
	(__gg__when_compiled): Likewise.
	(gets_int): Likewise.
	(gets_year): Likewise.
	(gets_month): Likewise.
	(gets_day): Likewise.
	(gets_day_of_week): Likewise.
	(gets_day_of_year): Likewise.
	(gets_week): Likewise.
	(gets_hours): Likewise.
	(gets_minutes): Likewise.
	(gets_seconds): Likewise.
	(gets_nanoseconds): Likewise.
	(fill_cobol_tm): Likewise.
	(__gg__hex_of): Likewise.
	(floating_format_tester): Likewise.
	(__gg__numval_f): Likewise.
	(__gg__test_numval_f): Likewise.
	(strcasestr): Likewise.
	(strlaststr): Likewise.
	(__gg__locale_compare): Likewise.
	(__gg__locale_date): Likewise.
	(__gg__locale_time): Likewise.
	(__gg__locale_time_from_seconds): Likewise.
	* libgcobol.cc (struct program_state): Likewise.
	(turn_sign_bit_on): Likewise.
	(turn_sign_bit_off): Likewise.
	(is_sign_bit_on): Likewise.
	(__gg__string_to_alpha_edited_ascii): Likewise.
	(int128_to_field): Likewise.
	(edited_to_binary): Likewise.
	(get_binary_value_local): Likewise.
	(__gg__get_date_yymmdd): Likewise.
	(__gg__get_date_yyyymmdd): Likewise.
	(__gg__get_date_yyddd): Likewise.
	(__gg__get_yyyyddd): Likewise.
	(__gg__get_date_dow): Likewise.
	(__gg__get_date_hhmmssff): Likewise.
	(__gg__dirty_to_binary_internal): Likewise.
	(__gg__dirty_to_binary): Likewise.
	(__gg__dirty_to_float): Likewise.
	(psz_to_internal): Likewise.
	(get_scaled_rdigits): Likewise.
	(format_for_display_internal): Likewise.
	(format_for_display_local): Likewise.
	(compare_88): Likewise.
	(compare_field_class): Likewise.
	(compare_strings): Likewise.
	(__gg__compare_2): Likewise.
	(init_var_both): Likewise.
	(alpha_to_alpha_move_from_location): Likewise.
	(alpha_to_alpha_move): Likewise.
	(__gg__move): Likewise.
	(__gg__move_literala): Likewise.
	(normalize_id): Likewise.
	(inspect_backward_format_1): Likewise.
	(__gg__inspect_format_1): Likewise.
	(inspect_backward_format_2): Likewise.
	(__gg__inspect_format_2): Likewise.
	(normalize_for_inspect_format_4): Likewise.
	(__gg__inspect_format_4): Likewise.
	(move_string): Likewise.
	(brute_force_trim): Likewise.
	(__gg__string): Likewise.
	(display_both): Likewise.
	(__gg__display_string): Likewise.
	(not_mangled_core): Likewise.
	(__gg__accept): Likewise.
	(__gg__set_initial_switch_value): Likewise.
	(__gg__onetime_initialization): Likewise.
	(is_numeric_display_numeric): Likewise.
	(is_alpha_a_number): Likewise.
	(__gg__classify): Likewise.
	(__gg__convert_encoding): Likewise.
	(__gg__convert_encoding_length): Likewise.
	(accept_envar): Likewise.
	(__gg__accept_envar): Likewise.
	(__gg__set_envar): Likewise.
	(__gg__get_argc): Likewise.
	(__gg__get_argv): Likewise.
	(__gg__get_command_line): Likewise.
	(__gg__alphabet_use): Likewise.
	(__gg__ascii_to_internal_field): Likewise.
	(__gg__ascii_to_internal): Likewise.
	(__gg__console_to_internal): Likewise.
	(__gg__parser_set_conditional): Likewise.
	(__gg__internal_to_console_in_place): Likewise.
	(__gg__literaln_alpha_compare): Likewise.
	(__gg__unstring): Likewise.
	(struct cbl_exception_t): Likewise.
	(__gg__codeset_figurative_constants): Likewise.
	(__gg__function_handle_from_cobpath): Likewise.
	(__gg__just_mangle_name): Likewise.
	(__gg__function_handle_from_name): Likewise.
	(get_the_byte): Likewise.
	(__gg__set_env_name): Likewise.
	(__gg__get_env_name): Likewise.
	(__gg__get_env_value): Likewise.
	(__gg__set_env_value): Likewise.
	(__gg__fprintf_stderr): Likewise.
	(__gg__accept_arg_value): Likewise.
	(__gg__fc_char): Likewise.
	* libgcobol.h (__gg__dirty_to_binary_internal): Likewise.
	(__gg__dirty_to_binary): Likewise.
	(__gg__internal_to_console_in_place): Likewise.
	(__gg__fc_char): Likewise.
	(__gg__convert_encoding): Likewise.
	(__gg__convert_encoding_length): Likewise.
	* stringbin.cc (string_from_combined): Likewise.
	(__gg__binary_to_string_internal): Likewise.
	(__gg__binary_to_string_encoded): Likewise.
	(__gg__numeric_display_to_binary): Likewise.
	(__gg__packed_to_binary): Likewise.
	* stringbin.h (__gg__binary_to_string_internal): Likewise.
	(__gg__binary_to_string_encoded): Likewise.
	(__gg__numeric_display_to_binary): Likewise.
	* valconv.cc (__gg__alphabet_create): Likewise.
	(__gg__string_to_numeric_edited): Likewise.
	(__gg__string_to_alpha_edited): Likewise.
	(__gg__remove_trailing_zeroes): Likewise.
	* valconv.h (__VALCONV_H): Likewise.
	* encodings.h: New file.

gcc/testsuite/ChangeLog:

	* cobol.dg/group1/check_88.cob: Likewise.
2025-10-10 13:19:34 -04:00
GCC Administrator
7f57e04ce4 Daily bump. 2025-10-05 16:50:51 +00:00
Sam James
ac273977ad *: regenerate autotools
libatomic/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libcc1/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.

libffi/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* include/Makefile.in: Regenerate.
	* man/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libgcobol/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libgfortran/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libgm2/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* libm2cor/Makefile.in: Regenerate.
	* libm2iso/Makefile.in: Regenerate.
	* libm2log/Makefile.in: Regenerate.
	* libm2min/Makefile.in: Regenerate.
	* libm2pim/Makefile.in: Regenerate.

libgomp/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libgrust/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* libformat_parser/Makefile.in: Regenerate.
	* libproc_macro_internal/Makefile.in: Regenerate.

libitm/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libobjc/ChangeLog:

	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libphobos/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libquadmath/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libsanitizer/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* asan/Makefile.in: Regenerate.
	* configure: Regenerate.
	* hwasan/Makefile.in: Regenerate.
	* interception/Makefile.in: Regenerate.
	* libbacktrace/Makefile.in: Regenerate.
	* lsan/Makefile.in: Regenerate.
	* sanitizer_common/Makefile.in: Regenerate.
	* tsan/Makefile.in: Regenerate.
	* ubsan/Makefile.in: Regenerate.

libssp/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* python/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++17/Makefile.in: Regenerate.
	* src/c++20/Makefile.in: Regenerate.
	* src/c++23/Makefile.in: Regenerate.
	* src/c++26/Makefile.in: Regenerate.
	* src/c++98/Makefile.in: Regenerate.
	* src/experimental/Makefile.in: Regenerate.
	* src/filesystem/Makefile.in: Regenerate.
	* src/libbacktrace/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libvtv/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

lto-plugin/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
2025-10-05 17:14:49 +01:00
GCC Administrator
1179ac1fab Daily bump. 2025-09-06 00:20:34 +00:00
Robert Dubner
dc20fa683d cobol: Improved handling of COBOL Special Registers.
COBOL Special Registers (e.g., RETURN-CODE; DEBUG-ITEM) are implemented as
global variables.  These changes define them with the prefix "__ggsr__" in
their variable names so that the GDB-COBOL debugger can identify them.

The creation and handling of such variables has been streamlined with the
introduction of the "register_e" cbl_field_t::attr bit.

gcc/cobol/ChangeLog:

	* genapi.cc (trace1_init): Prepend two internal variables with
	underscore.
	(initialize_variable_internal): Use new register_e attribute.
	(psa_global): Use "__ggsr__" prefix to identify special registers
	(parser_symbol_add): Use new register_e attribute.
	* symbols.cc (cbl_field_attr_str): Likewise.
	(symbol_table_init): Likewise.
	(is_register_field): Eliminated in favor of (attr & register_e).
	* symbols.h (is_register_field): Likewise.

libgcobol/ChangeLog:

	* common-defs.h (enum cbl_field_attr_t): Define register_e.
	* constants.cc (struct cblc_field_t): Define special registers with
	"__ggsr__" prefix.
2025-09-05 11:08:27 -04:00
GCC Administrator
d670769bf6 Daily bump. 2025-08-21 00:20:43 +00:00
Robert Dubner
e78eb2f85b cobol: Eliminate errors that cause valgrind messages.
gcc/cobol/ChangeLog:

	* genutil.cc (get_binary_value): Fix a comment.
	* parse.y: udf_args_valid(): Fix loc calculation.
	* symbols.cc (assert): extend_66_capacity(): Avoid assert(e < e2) in
	-O0 build until symbol_table expansion is fixed.

libgcobol/ChangeLog:

	* libgcobol.cc (format_for_display_internal): Handle NumericDisplay
	properly.
	(compare_88): Fix memory access error.
	(__gg__unstring): Likewise.
2025-08-19 23:29:43 -04:00
GCC Administrator
6520bb9efb Daily bump. 2025-08-14 00:20:55 +00:00
Mark Wielaard
eecff13cdc Regenerate libgcobol/configure
Use autoconf 2.69 to regenerate libgcobol/configure

Fixes: 9992c0a0e1 ("cobol: Bring EBCDIC NumericDisplay variables into IBM compliance.")

libgcobol/ChangeLog:

	* configure: Regenerate.
2025-08-13 17:53:27 +02:00
Robert Dubner
33e26a071f cobol: Implement and use faster __gg__packed_to_binary() routine.
The new routine uses table lookups more effectively, and avoids __int128
arithmetic until necessary.

gcc/cobol/ChangeLog:

	* genutil.cc (get_binary_value): Use the new routine.

libgcobol/ChangeLog:

	* libgcobol.cc (get_binary_value_local): Use the new routine.
	* stringbin.cc (int_from_string): Removed.
	(__gg__packed_to_binary): Implement new routine.
	* stringbin.h (__gg__packed_to_binary): Likewise.
2025-08-13 11:33:41 -04:00
Robert Dubner
67e0490922 cobol: Implement faster zoned decimal to binary conversion.
Replace " value *= 10; value += digit" routines with a new one that does two
digits at a time and avoids __int128 calculations until they are necessary.

These changes also clean up the conversion behavior when a digit is not valid.

gcc/cobol/ChangeLog:

	* genutil.cc (get_binary_value): Use the new routine.

libgcobol/ChangeLog:

	* libgcobol.cc (int128_to_field): Use the new routine.
	(get_binary_value_local): Use the new routine.
	(format_for_display_internal): Formatting.
	(__gg__get_file_descriptor): Likewise.
	* stringbin.cc (string_from_combined): Formatting.
	(packed_from_combined): Likewise.
	(int_from_string): New routine.
	(__gg__numeric_display_to_binary): Likewise.
	* stringbin.h (__gg__numeric_display_to_binary): Likewise.
2025-08-12 22:23:47 -04:00