Skip to content
Snippets Groups Projects
  1. Feb 21, 2025
  2. Feb 20, 2025
    • Andre Vehreschild's avatar
      Fortran: Remove deprecated coarray routines [PR107635] · d3244675
      Andre Vehreschild authored
      gcc/fortran/ChangeLog:
      
      	PR fortran/107635
      
      	* gfortran.texi: Remove deprecated functions from documentation.
      	* trans-decl.cc (gfc_build_builtin_function_decls): Remove
      	decprecated function decls.
      	* trans-intrinsic.cc (gfc_conv_intrinsic_exponent): Remove
      	deprecated/no longer needed routines.
      	* trans.h: Remove unused decls.
      
      libgfortran/ChangeLog:
      
      	* caf/libcaf.h (_gfortran_caf_get): Removed because deprecated.
      	(_gfortran_caf_send): Same.
      	(_gfortran_caf_sendget): Same.
      	(_gfortran_caf_send_by_ref): Same.
      	* caf/single.c (assign_char4_from_char1): Same.
      	(assign_char1_from_char4): Same.
      	(convert_type): Same.
      	(defined): Same.
      	(_gfortran_caf_get): Same.
      	(_gfortran_caf_send): Same.
      	(_gfortran_caf_sendget): Same.
      	(copy_data): Same.
      	(get_for_ref): Same.
      	(_gfortran_caf_get_by_ref): Same.
      	(send_by_ref): Same.
      	(_gfortran_caf_send_by_ref): Same.
      	(_gfortran_caf_sendget_by_ref): Same.
      d3244675
    • Andre Vehreschild's avatar
      Fortran: Add transfer_between_remotes [PR107635] · 8bf0ee8d
      Andre Vehreschild authored
      Add the last missing coarray data manipulation routine using remote
      accessors.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/107635
      
      	* coarray.cc (rewrite_caf_send): Rewrite to
      	transfer_between_remotes when both sides of the assignment have
      	a coarray.
      	(coindexed_code_callback): Prevent duplicate rewrite.
      	* gfortran.texi: Add documentation for transfer_between_remotes.
      	* intrinsic.cc (add_subroutines): Add intrinsic symbol for
      	caf_sendget to allow easy rewrite to transfer_between_remotes.
      	* trans-decl.cc (gfc_build_builtin_function_decls): Add
      	prototype for transfer_between_remotes.
      	* trans-intrinsic.cc (conv_caf_vector_subscript_elem): Mark as
      	deprecated.
      	(conv_caf_vector_subscript): Same.
      	(compute_component_offset): Same.
      	(conv_expr_ref_to_caf_ref): Same.
      	(conv_stat_and_team): Extract stat and team from expr.
      	(gfc_conv_intrinsic_caf_get): Use conv_stat_and_team.
      	(conv_caf_send_to_remote): Same.
      	(has_ref_after_cafref): Mark as deprecated.
      	(conv_caf_sendget): Translate to transfer_between_remotes.
      	* trans.h: Add prototype for transfer_between_remotes.
      
      libgfortran/ChangeLog:
      
      	* caf/libcaf.h: Add prototype for transfer_between_remotes.
      	* caf/single.c: Implement transfer_between_remotes.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/coarray_lib_comm_1.f90: Fix up scan_trees.
      8bf0ee8d
    • Andre Vehreschild's avatar
      Fortran: Add send_to_remote [PR107635] · 69eb0268
      Andre Vehreschild authored
      Refactor to use send_to_remote instead of the slow send_by_ref.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/107635
      
      	* coarray.cc (move_coarray_ref): Move the coarray reference out
      	of the given one.  Especially when there is a regular array ref.
      	(fixup_comp_refs): Move components refs to a derived type where
      	the codim has been removed, aka a new type.
      	(split_expr_at_caf_ref): Correctly split the reference chain.
      	(remove_caf_ref): Simplify.
      	(create_get_callback): Fix some deficiencies.
      	(create_allocated_callback): Adapt to new signature of split.
      	(create_send_callback): New function.
      	(rewrite_caf_send): Rewrite a call to caf_send to
      	caf_send_to_remote.
      	(coindexed_code_callback): Treat caf_send and caf_sendget
      	correctly.
      	* gfortran.h (enum gfc_isym_id): Add SENDGET-isym.
      	* gfortran.texi: Add documentation for send_to_remote.
      	* resolve.cc (gfc_resolve_code): No longer generate send_by_ref
      	when allocatable coarray (component) is on the lhs.
      	* trans-decl.cc (gfc_build_builtin_function_decls): Add
      	caf_send_to_remote decl.
      	* trans-intrinsic.cc (conv_caf_func_index): Ensure the static
      	variables created are not in a block-scope.
      	(conv_caf_send_to_remote): Translate caf_send_to_remote calls.
      	(conv_caf_send): Renamed to conv_caf_sendget.
      	(conv_caf_sendget): Renamed from conv_caf_send.
      	(gfc_conv_intrinsic_subroutine): Branch correctly for
      	conv_caf_send and sendget.
      	* trans.h: Correct decl.
      
      libgfortran/ChangeLog:
      
      	* caf/libcaf.h: Add/Correct prototypes for caf_get_from_remote,
      	caf_send_to_remote.
      	* caf/single.c (struct accessor_hash_t): Rename accessor_t to
      	getter_t.
      	(_gfortran_caf_register_accessor): Use new name of getter_t.
      	(_gfortran_caf_send_to_remote): New function for sending data to
      	coarray on a remote image.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/coarray/send_char_array_1.f90: Extend test to
      	catch more cases.
      	* gfortran.dg/coarray_42.f90: Invert tests use, because no
      	longer a send is needed when local memory in a coarray is
      	allocated.
      69eb0268
    • Andre Vehreschild's avatar
      Fortran: Add caf_is_present_on_remote. [PR107635] · 15847252
      Andre Vehreschild authored
      Replace caf_is_present by caf_is_present_on_remote which is using a
      dedicated callback for each object to test on the remote image.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/107635
      
      	* coarray.cc (create_allocated_callback): Add creating remote
      	side procedure for checking allocation status of coarray.
      	(rewrite_caf_allocated): Rewrite ALLOCATED on coarray to use caf
      	routine.
      	(coindexed_expr_callback): Exempt caf_is_present_on_remote from
      	being rewritten again.
      	* gfortran.h (enum gfc_isym_id): Add caf_is_present_on_remote
      	id.
      	* gfortran.texi: Add documentation for caf_is_present_on_remote.
      	* intrinsic.cc (add_functions): Add caf_is_present_on_remote
      	symbol.
      	* trans-decl.cc (gfc_build_builtin_function_decls): Define
      	interface of caf_is_present_on_remote.
      	* trans-intrinsic.cc (gfc_conv_intrinsic_caf_is_present_remote):
      	Translate caf_is_present_on_remote.
      	(trans_caf_is_present): Remove.
      	(caf_this_image_ref): Remove.
      	(gfc_conv_allocated): Take out coarray treatment, because that
      	is rewritten to caf_is_present_on_remote now.
      	(gfc_conv_intrinsic_function): Handle caf_is_present_on_remote
      	calls.
      	* trans.h: Add symbol for caf_is_present_on_remote and remove
      	old one.
      
      libgfortran/ChangeLog:
      
      	* caf/libcaf.h (_gfortran_caf_is_present_on_remote): Add new
      	function.
      	(_gfortran_caf_is_present): Remove deprecated one.
      	* caf/single.c (struct accessor_hash_t): Add function ptr access
      	for remote side call.
      	(_gfortran_caf_is_present_on_remote): Added.
      	(_gfortran_caf_is_present): Removed.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/coarray/coarray_allocated.f90: Adapt to new method
      	of checking on remote image.
      	* gfortran.dg/coarray_lib_alloc_4.f90: Same.
      15847252
    • Andre Vehreschild's avatar
      Fortran: Allow to use non-pure/non-elemental functions in coarray indexes [PR107635] · abbfeb2e
      Andre Vehreschild authored
      Extract calls to non-pure or non-elemental functions from index
      expressions on a coarray.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/107635
      
      	* coarray.cc (get_arrayspec_from_expr): Treat array result of
      	function calls correctly.
      	(remove_coarray_from_derived_type): Prevent memory loss.
      	(add_caf_get_from_remote): Correct locus.
      	(find_comp): New function to find or create a new component in a
      	derived type.
      	(check_add_new_comp_handle_array): Handle allocatable arrays or
      	non-pure/non-elemental functions in indexes of coarrays.
      	(check_add_new_component): Use above function.
      	(create_get_parameter_type): Rename to
      	create_caf_add_data_parameter_type.
      	(create_caf_add_data_parameter_type): Renaming of variable and
      	make the additional data a coarray.
      	(remove_caf_ref): Factor out to reuse in other caf-functions.
      	(create_get_callback): Use function factored out, set locus
      	correctly and ensure a kind is set for parameters.
      	(add_caf_get_intrinsic): Rename to add_caf_get_from_remote and
      	rename some variables.
      	(coindexed_expr_callback): Skip over function created by the
      	rewriter.
      	(coindexed_code_callback): Filter some intrinsics not to
      	process.
      	(gfc_coarray_rewrite): Rewrite also contained functions.
      	* trans-intrinsic.cc (gfc_conv_intrinsic_caf_get): Reflect
      	changed order on caf_get_from_remote ().
      
      libgfortran/ChangeLog:
      
      	* caf/libcaf.h (_gfortran_caf_register_accessor): Reflect
      	changed parameter order.
      	* caf/single.c (struct accessor_hash_t): Same.
      	(_gfortran_caf_register_accessor): Call accessor using a token
      	for accessing arrays with a descriptor on the source side.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/coarray_lib_comm_1.f90: Adapt scan expression.
      	* gfortran.dg/coarray/get_with_fn_parameter.f90: New test.
      	* gfortran.dg/coarray/get_with_scalar_fn.f90: New test.
      abbfeb2e
    • Andre Vehreschild's avatar
      Fortran: Prepare for more caf-rework. [PR107635] · b114312b
      Andre Vehreschild authored
      Factor out generation of code to get remote function index and to
      create the additional data structure.  Rename caf_get_by_ct to
      caf_get_from_remote.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/107635
      
      	* gfortran.texi: Rename caf_get_by_ct to caf_get_from_remote.
      	* trans-decl.cc (gfc_build_builtin_function_decls): Rename
      	intrinsic.
      	* trans-intrinsic.cc (conv_caf_func_index): Factor out
      	functionality to be reused by other caf-functions.
      	(conv_caf_add_call_data): Same.
      	(gfc_conv_intrinsic_caf_get): Use functions factored out.
      	* trans.h: Rename intrinsic symbol.
      
      libgfortran/ChangeLog:
      
      	* caf/libcaf.h (_gfortran_caf_get_by_ref): Remove from ABI.
      	This function is replaced by caf_get_from_remote ().
      	(_gfortran_caf_get_remote_function_index): Use better name.
      	* caf/single.c (_gfortran_caf_finalize): Free internal data.
      	(_gfortran_caf_get_by_ref): Remove from public interface, but
      	keep it, because it is still used by sendget ().
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/coarray_lib_comm_1.f90: Adapt to renamed ABI
      	function.
      	* gfortran.dg/coarray_stat_function.f90: Same.
      	* gfortran.dg/coindexed_1.f90: Same.
      b114312b
    • Andre Vehreschild's avatar
      Fortran: Move caf_get-rewrite to coarray.cc [PR107635] · 90ba8291
      Andre Vehreschild authored
      Add a rewriter to keep all expression tree that is not optimization
      together.  At the moment this is just a move from resolve.cc, but will
      be extended to handle more cases where rewriting the expression tree may
      be easier.  The first use case is to extract accessors for coarray
      remote image data access.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/107635
      	* Make-lang.in: Add coarray.cc.
      	* coarray.cc: New file.
      	* gfortran.h (gfc_coarray_rewrite): New procedure.
      	* parse.cc (rewrite_expr_tree): Add entrypoint for rewriting
      	expression trees.
      	* resolve.cc (gfc_resolve_ref): Remove caf_lhs handling.
      	(get_arrayspec_from_expr): Moved to rewrite.cc.
      	(remove_coarray_from_derived_type): Same.
      	(convert_coarray_class_to_derived_type): Same.
      	(split_expr_at_caf_ref): Same.
      	(check_add_new_component): Same.
      	(create_get_parameter_type): Same.
      	(create_get_callback): Same.
      	(add_caf_get_intrinsic): Same.
      	(resolve_variable): Remove caf_lhs handling.
      
      libgfortran/ChangeLog:
      
      	* caf/single.c (_gfortran_caf_finalize): Free memory preventing
      	leaks.
      	(_gfortran_caf_get_by_ct): Fix constness.
      	* caf/libcaf.h (_gfortran_caf_register_accessor): Fix constness.
      90ba8291
  3. Feb 07, 2025
  4. Feb 06, 2025
    • Jerry DeLisle's avatar
      Fortran: Fix handling of the X edit descriptor. · cfed9975
      Jerry DeLisle authored
      This patch is a partial fix of handling of X edit descriptors
      when combined with certain T edit descriptors.
      
      	PR libfortran/114618
      
      libgfortran/ChangeLog:
      
      	* io/transfer.c (formatted_transfer_scalar_write): Change name
      	of vriable 'pos' to 'tab_pos' to improve clarity. Add new
      	variable next_pos when calculating the maximum position.
      	Update the calculation of pending spaces.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/pr114618.f90: New test.
      cfed9975
  5. Feb 05, 2025
  6. Feb 04, 2025
    • Thomas Koenig's avatar
      Add modular exponentiation for UNSIGNED. · c2a0ee58
      Thomas Koenig authored
      gcc/fortran/ChangeLog:
      
      	* arith.cc (arith_power): Handle modular arithmetic for
      	BT_UNSIGNED.
      	(eval_intrinsic):  Error for unsigned exponentiation with
      	-pedantic.
      	* expr.cc (gfc_type_convert_binary): Use type of first
      	argument for unsigned exponentiation.
      	* gfortran.texi: Mention arithmetic exponentiation.
      	* resolve.cc (resolve_operator): Allow unsigned exponentiation.
      	* trans-decl.cc (gfc_build_intrinsic_function_decls): Build
      	declarations for unsigned exponentiation.
      	* trans-expr.cc (gfc_conv_cst_uint_power): New function.
      	(gfc_conv_power_op): Call it.  Handle unsigned exponentiation.
      	* trans.h (gfor_fndecl_unsigned_pow_list):  Add declaration.
      
      libgfortran/ChangeLog:
      
      	* Makefile.am: Add files for unsigned exponentiation.
      	* Makefile.in: Regenerate.
      	* gfortran.map: Add functions for unsigned exponentiation.
      	* generated/pow_m16_m1.c: New file.
      	* generated/pow_m16_m16.c: New file.
      	* generated/pow_m16_m2.c: New file.
      	* generated/pow_m16_m4.c: New file.
      	* generated/pow_m16_m8.c: New file.
      	* generated/pow_m1_m1.c: New file.
      	* generated/pow_m1_m16.c: New file.
      	* generated/pow_m1_m2.c: New file.
      	* generated/pow_m1_m4.c: New file.
      	* generated/pow_m1_m8.c: New file.
      	* generated/pow_m2_m1.c: New file.
      	* generated/pow_m2_m16.c: New file.
      	* generated/pow_m2_m2.c: New file.
      	* generated/pow_m2_m4.c: New file.
      	* generated/pow_m2_m8.c: New file.
      	* generated/pow_m4_m1.c: New file.
      	* generated/pow_m4_m16.c: New file.
      	* generated/pow_m4_m2.c: New file.
      	* generated/pow_m4_m4.c: New file.
      	* generated/pow_m4_m8.c: New file.
      	* generated/pow_m8_m1.c: New file.
      	* generated/pow_m8_m16.c: New file.
      	* generated/pow_m8_m2.c: New file.
      	* generated/pow_m8_m4.c: New file.
      	* generated/pow_m8_m8.c: New file.
      	* m4/powu.m4: New file.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/unsigned_15.f90: Adjust error messages.
      	* gfortran.dg/unsigned_43.f90: New test.
      	* gfortran.dg/unsigned_44.f90: New test.
      c2a0ee58
  7. Jan 25, 2025
  8. Jan 24, 2025
    • Jerry DeLisle's avatar
      Fortran: Fix UTF-8 output with A edit descriptor. · 4daf0881
      Jerry DeLisle authored
      	This adjusts the source len for the case where the user has
      	specified a field width with the A descriptor.
      
      	PR libfortran/118571
      
      libgfortran/ChangeLog:
      
      	* io/write.c (write_utf8_char4): Adjust the src_len to the
      	format width w_len when greater than zero.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/utf8_3.f03: New test.
      4daf0881
  9. Jan 18, 2025
  10. Jan 17, 2025
  11. Jan 16, 2025
  12. Jan 02, 2025
  13. Dec 24, 2024
    • GCC Administrator's avatar
      Daily bump. · 4a8af01b
      GCC Administrator authored
      4a8af01b
    • Hans-Peter Nilsson's avatar
      libgfortran: Fix build for targets with int32_t=long int · a5b1f3e1
      Hans-Peter Nilsson authored
      Without this, after r15-6415-g586477d67bf2e3, you'll see,
      for targets where int32_t is a typedef of long int (beware
      of artificially broken lines):
      
      /x/gcc/libgfortran/caf/single.c: In function '_gfortran_caf_get_by_ct':
      /x/gcc/libgfortran/caf/single.c:2943:56: error: passing argument 2 of '\
      (accessor_hash_table + (sizetype)((unsigned int)getter_index * 12))->ac\
      cessor' from incompatible pointer type [-Wincompatible-pointer-types]
       2943 |   accessor_hash_table[getter_index].accessor (dst_ptr, &free_bu\
      ffer, src_ptr,
            |                                                        ^~~~~~~~\
      ~~~~
            |                                                        |
            |                                                        int *
      /x/gcc/libgfortran/caf/single.c:2943:56: note: expected 'int32_t *' {ak\
      a 'long int *'} but argument is of type 'int *'
      
      libgfortran:
      	* caf/single.c (_gfortran_caf_get_by_ct): Correct type of free_buffer
      	to int32_t.
      a5b1f3e1
  14. Dec 23, 2024
  15. Dec 22, 2024
    • Andre Vehreschild's avatar
      Fortran: Replace getting of coarray data with accessor-based version. [PR107635] · 586477d6
      Andre Vehreschild authored
      Getting coarray data from remote images was slow, inefficient and did
      not work for object files that where not compiled with coarray support
      for derived types with allocatable/pointer components.  The old approach
      emulated accessing data through a whole structure ref, which was error
      prone for corner cases.  Furthermore was did it have a runtime
      complexity of O(N), where N is the number of allocatable/pointer
      components and descriptors involved.  Each of those needed communication
      twice.  The new approach creates a routine for each access into a
      coarray object putting all required operations there.  Looking a
      tree-dump one will see those small routines.  But this time it is just
      compiled fortran with all the knowledge of the compiler of bounds and so
      on.  New paradigms will be available out of the box.  Furthermore is the
      complexity of the communication reduced to be O(1).  E.g. the mpi
      implementation sends one message for the parameters of the access and
      one message back with the results without caring about the number of
      allocatable/pointer/descriptor components in the access.
      
      Identification of access routines is done be adding them to a hash map,
      where the hash is the same on all images.  Translating the hash to an
      index, which is the same on all images again, allows for fast calls of
      the access routines.  Resolving the hash to an index is cached at
      runtime, preventing additional hash map lookups.  A hashmap was use
      because not all processor OS combinations may use the same address for
      the access routine.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/107635
      
      	* gfortran.h (gfc_add_caf_accessor): New function.
      	* gfortran.texi: Document new API routines.
      	* resolve.cc (get_arrayspec_from_expr): Synthesize the arrayspec
      	resulting from an expression, i.e. not only the rank, but also
      	the bounds.
      	(remove_coarray_from_derived_type): Remove coarray ref from a
      	derived type to access it in access routine.
      	(convert_coarray_class_to_derived_type): Same but for classes.
      	The result is a derived type.
      	(split_expr_at_caf_ref): Split an expression at the coarray
      	reference to move the reference after the coarray ref into the
      	access routine.
      	(check_add_new_component): Helper to add variables as
      	components to derived type transfered to the access routine.
      	(create_get_parameter_type): Create the derived type to transfer
      	addressing data to the access routine.
      	(create_get_callback): Create the access routine.
      	(add_caf_get_intrinsic): Use access routine instead of old
      	caf_get.
      	* trans-decl.cc (gfc_build_builtin_function_decls): Register new
      	API routines.
      	(gfc_create_module_variable): Use renamed flag.
      	(gfc_emit_parameter_debug_info):
      	(struct caf_accessor): Linked list of hash-access routine pairs.
      	(gfc_add_caf_accessor): Add a hash-access routine pair to above
      	linked list.
      	(create_caf_accessor_register): Add all registered hash-access
      	routine pairs to the current caf_init.
      	(generate_coarray_init): Use routine above.
      	(gfc_generate_module_vars): Use renamed flag.
      	(generate_local_decl): Same.
      	(gfc_generate_function_code): Same.
      	(gfc_process_block_locals): Same.
      	* trans-intrinsic.cc (conv_shape_to_cst): Build the product of a
      	shape.
      	(gfc_conv_intrinsic_caf_get): Create call to access routine.
      	(conv_caf_send): Adapt to caf_get using less arguments.
      	(gfc_conv_intrinsic_function): Same.
      	* trans.cc (gfc_trans_force_lval): Helper to ensure that an
      	expression can be used as an lvalue-ref.
      	* trans.h (gfc_trans_force_lval): See above.
      
      libgfortran/ChangeLog:
      
      	* caf/libcaf.h (_gfortran_caf_register_accessor): New function
      	to register access routines at runtime.
      	(_gfortran_caf_register_accessors_finish): New function to
      	finish registration of access routine and sort hash map.
      	(_gfortran_caf_get_remote_function_index): New function to
      	convert an hash to an index.
      	(_gfortran_caf_get_by_ct): New function to get data from a
      	remote image using the access routine given by an index.
      	* caf/single.c (struct accessor_hash_t): Hashmap type.
      	(_gfortran_caf_send): Fixed formatting.
      	(_gfortran_caf_register_accessor): Register a hash accessor
      	routine.
      	(hash_compare): Compare two hashes for sort() and bsearch().
      	(_gfortran_caf_register_accessors_finish): Sort the hashmap to
      	allow bsearch()'s quick lookup.
      	(_gfortran_caf_get_remote_function_index): Map a hash to an
      	index.
      	(_gfortran_caf_get_by_ct): Get data from a remote image using
      	the index provided by get_remote_function_index().
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/coarray_atomic_5.f90: Adapted to look for
      	get_by_ct.
      	* gfortran.dg/coarray_lib_comm_1.f90: Same.
      	* gfortran.dg/coarray_stat_function.f90: Same.
      586477d6
  16. Dec 21, 2024
  17. Dec 20, 2024
    • Andre Vehreschild's avatar
      Fortran: Fix caf_stop_numeric and reporting exceptions from caf [PR57598] · a25cc268
      Andre Vehreschild authored
      Caf_stop_numeric always exited with code 0, which is wrong.  It shall
      behave like regular stop.  Add reporting exceptions to caf's stop
      handlers.  For this the existing library routine had to be exported.
      
      libgfortran/ChangeLog:
      
      	PR fortran/57598
      
      	* caf/single.c (_gfortran_caf_stop_numeric): Report exceptions
      	on stop. And fix send_by_ref.
      	(_gfortran_caf_stop_str): Same.
      	(_gfortran_caf_error_stop_str): Same.
      	(_gfortran_caf_error_stop): Same.
      	* gfortran.map: Add report_exception for export.
      	* libgfortran.h (report_exception): Add to internal export.
      	* runtime/stop.c (report_exception): Same.
      a25cc268
  18. Dec 11, 2024
  19. Dec 10, 2024
    • Jerry DeLisle's avatar
      Fortran: Fix READ with padding in BLANK ZERO mode. · cf406a6c
      Jerry DeLisle authored
      	PR fortran/117819
      
      libgfortran/ChangeLog:
      
      	* io/read.c (read_decimal): If the read value is short of the
      	specified width and pad mode is PAD yes, check for BLANK ZERO
      	and adjust the value accordingly.
      	(read_decimal_unsigned): Likewise.
      	(read_radix): Likewise.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/pr117819.f90: New test.
      cf406a6c
  20. Dec 05, 2024
  21. Dec 04, 2024
  22. Nov 24, 2024
  23. Nov 23, 2024
    • Jerry DeLisle's avatar
      Fortran: Reject missing comma in format. · fd118f4c
      Jerry DeLisle authored
      	Standards require rejecting formats where descriptors
      	are not separated by commas. This change allows this
      	the missing comma to be accepted only with
      	-std=legacy.
      
      	PR fortran/88052
      
      libgfortran/ChangeLog:
      
      	* io/format.c (parse_format_list): Reject missing comma in
      	format strings by default or if -std=f95 or higher. This is
      	a runtime error.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/comma_format_extension_4.f: Add missing comma.
      	* gfortran.dg/dollar_edit_descriptor_2.f: Likewise.
      	* gfortran.dg/fmt_error_9.f: Likewise.
      	* gfortran.dg/fmt_g0_5.f08: Likewise.
      	* gfortran.dg/fmt_t_2.f90: Likewise.
      	* gfortran.dg/pr88052.f90: New test.
      fd118f4c
  24. Oct 08, 2024
  25. Oct 07, 2024
    • Thomas Koenig's avatar
      Implement MAXLOC and MINLOC for unsigned. · c0002a67
      Thomas Koenig authored
      gcc/fortran/ChangeLog:
      
      	* check.cc (gfc_check_minloc_maxloc): Handle BT_UNSIGNED.
      	* trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Likewise.
      	* gfortran.texi: Document MAXLOC and MINLOC for UNSIGNED.
      
      libgfortran/ChangeLog:
      
      	* Makefile.am: Add files for unsigned MINLOC and MAXLOC.
      	* Makefile.in: Regenerated.
      	* gfortran.map: Add files for unsigned MINLOC and MAXLOC.
      	* generated/maxloc0_16_m1.c: New file.
      	* generated/maxloc0_16_m16.c: New file.
      	* generated/maxloc0_16_m2.c: New file.
      	* generated/maxloc0_16_m4.c: New file.
      	* generated/maxloc0_16_m8.c: New file.
      	* generated/maxloc0_4_m1.c: New file.
      	* generated/maxloc0_4_m16.c: New file.
      	* generated/maxloc0_4_m2.c: New file.
      	* generated/maxloc0_4_m4.c: New file.
      	* generated/maxloc0_4_m8.c: New file.
      	* generated/maxloc0_8_m1.c: New file.
      	* generated/maxloc0_8_m16.c: New file.
      	* generated/maxloc0_8_m2.c: New file.
      	* generated/maxloc0_8_m4.c: New file.
      	* generated/maxloc0_8_m8.c: New file.
      	* generated/maxloc1_16_m1.c: New file.
      	* generated/maxloc1_16_m2.c: New file.
      	* generated/maxloc1_16_m4.c: New file.
      	* generated/maxloc1_16_m8.c: New file.
      	* generated/maxloc1_4_m1.c: New file.
      	* generated/maxloc1_4_m16.c: New file.
      	* generated/maxloc1_4_m2.c: New file.
      	* generated/maxloc1_4_m4.c: New file.
      	* generated/maxloc1_4_m8.c: New file.
      	* generated/maxloc1_8_m1.c: New file.
      	* generated/maxloc1_8_m16.c: New file.
      	* generated/maxloc1_8_m2.c: New file.
      	* generated/maxloc1_8_m4.c: New file.
      	* generated/maxloc1_8_m8.c: New file.
      	* generated/minloc0_16_m1.c: New file.
      	* generated/minloc0_16_m16.c: New file.
      	* generated/minloc0_16_m2.c: New file.
      	* generated/minloc0_16_m4.c: New file.
      	* generated/minloc0_16_m8.c: New file.
      	* generated/minloc0_4_m1.c: New file.
      	* generated/minloc0_4_m16.c: New file.
      	* generated/minloc0_4_m2.c: New file.
      	* generated/minloc0_4_m4.c: New file.
      	* generated/minloc0_4_m8.c: New file.
      	* generated/minloc0_8_m1.c: New file.
      	* generated/minloc0_8_m16.c: New file.
      	* generated/minloc0_8_m2.c: New file.
      	* generated/minloc0_8_m4.c: New file.
      	* generated/minloc0_8_m8.c: New file.
      	* generated/minloc1_16_m1.c: New file.
      	* generated/minloc1_16_m16.c: New file.
      	* generated/minloc1_16_m2.c: New file.
      	* generated/minloc1_16_m4.c: New file.
      	* generated/minloc1_16_m8.c: New file.
      	* generated/minloc1_4_m1.c: New file.
      	* generated/minloc1_4_m16.c: New file.
      	* generated/minloc1_4_m2.c: New file.
      	* generated/minloc1_4_m4.c: New file.
      	* generated/minloc1_4_m8.c: New file.
      	* generated/minloc1_8_m1.c: New file.
      	* generated/minloc1_8_m16.c: New file.
      	* generated/minloc1_8_m2.c: New file.
      	* generated/minloc1_8_m4.c: New file.
      	* generated/minloc1_8_m8.c: New file.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/unsigned_35.f90: New test.
      c0002a67
  26. Oct 02, 2024
  27. Oct 01, 2024
    • Thomas Koenig's avatar
      Implement MAXVAL and MINVAL for UNSIGNED. · 9dd9a069
      Thomas Koenig authored
      gcc/fortran/ChangeLog:
      
      	* check.cc (int_or_real_or_char_or_unsigned_check_f2003): New function.
      	(gfc_check_minval_maxval): Use it.
      	* trans-intrinsic.cc (gfc_conv_intrinsic_minmaxval): Handle
      	initial values for UNSIGNED.
      	* gfortran.texi: Document MINVAL and MAXVAL for unsigned.
      
      libgfortran/ChangeLog:
      
      	* Makefile.am: Add minval and maxval files.
      	* Makefile.in: Regenerated.
      	* gfortran.map: Add new functions.
      	* generated/maxval_m1.c: New file.
      	* generated/maxval_m16.c: New file.
      	* generated/maxval_m2.c: New file.
      	* generated/maxval_m4.c: New file.
      	* generated/maxval_m8.c: New file.
      	* generated/minval_m1.c: New file.
      	* generated/minval_m16.c: New file.
      	* generated/minval_m2.c: New file.
      	* generated/minval_m4.c: New file.
      	* generated/minval_m8.c: New file.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/unsigned_34.f90: New test.
      9dd9a069
  28. Sep 25, 2024
  29. Sep 24, 2024
    • Thomas Koenig's avatar
      Add random numbers and fix some bugs. · 291e20e8
      Thomas Koenig authored
      This patch adds random number support for UNSIGNED, plus fixes
      two bugs, with array I/O where the type used to be set to BT_INTEGER,
      and for division with the divisor being a constant.
      
      gcc/fortran/ChangeLog:
      
      	* check.cc (gfc_check_random_number): Adjust for unsigned.
      	* iresolve.cc (gfc_resolve_random_number): Handle unsigned.
      	* trans-expr.cc (gfc_conv_expr_op): Handle BT_UNSIGNED for divide.
      	* trans-types.cc (gfc_get_dtype_rank_type): Handle BT_UNSIGNED.
      	* gfortran.texi: Add RANDOM_NUMBER for UNSIGNED.
      
      libgfortran/ChangeLog:
      
      	* gfortran.map: Add _gfortran_random_m1, _gfortran_random_m2,
      	_gfortran_random_m4, _gfortran_random_m8 and _gfortran_random_m16.
      	* intrinsics/random.c (random_m1): New function.
      	(random_m2): New function.
      	(random_m4): New function.
      	(random_m8): New function.
      	(random_m16): New function.
      	(arandom_m1): New function.
      	(arandom_m2): New function.
      	(arandom_m4): New function.
      	(arandom_m8): New funciton.
      	(arandom_m16): New function.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/unsigned_30.f90: New test.
      291e20e8
    • Thomas Koenig's avatar
      Implement SUM and PRODUCT for unsigned. · 5e918a4d
      Thomas Koenig authored
      gcc/fortran/ChangeLog:
      
      	* gfortran.texi: Document SUM and PRODUCT.
      	* iresolve.cc (resolve_transformational): New argument,
      	use_integer, to translate calls to unsigned to calls to
      	integer.
      	(gfc_resolve_product): Use it
      	(gfc_resolve_sum): Use it.
      	* simplify.cc (init_result_expr): Handle BT_UNSIGNED.
      
      libgfortran/ChangeLog:
      
      	* generated/product_c10.c: Regenerated.
      	* generated/product_c16.c: Regenerated.
      	* generated/product_c17.c: Regenerated.
      	* generated/product_c4.c: Regenerated.
      	* generated/product_c8.c: Regenerated.
      	* generated/product_i1.c: Regenerated.
      	* generated/product_i16.c: Regenerated.
      	* generated/product_i2.c: Regenerated.
      	* generated/product_i4.c: Regenerated.
      	* generated/product_i8.c: Regenarated.
      	* generated/product_r10.c: Regenerated.
      	* generated/product_r16.c: Regenerated.
      	* generated/product_r17.c: Regenerated.
      	* generated/product_r4.c: Regenerated.
      	* generated/product_r8.c: Regenarated.
      	* generated/sum_c10.c: Regenerated.
      	* generated/sum_c16.c: Regenerated.
      	* generated/sum_c17.c: Regenerated.
      	* generated/sum_c4.c: Regenerated.
      	* generated/sum_c8.c: Regenerated.
      	* generated/sum_i1.c: Regenerated.
      	* generated/sum_i16.c: Regenerated.
      	* generated/sum_i2.c: Regenerated.
      	* generated/sum_i4.c: Regenerated.
      	* generated/sum_i8.c: Regenerated.
      	* generated/sum_r10.c: Regenerated.
      	* generated/sum_r16.c: Regenerated.
      	* generated/sum_r17.c: Regenerated.
      	* generated/sum_r4.c: Regenerated.
      	* generated/sum_r8.c: Regenerated.
      	* m4/ifunction.m4: Whitespace fix.
      	* m4/product.m4: If type is integer, change to unsigned.
      	* m4/sum.m4: Likewise.
      5e918a4d
Loading