diff options
Diffstat (limited to 'gcc/fortran/ChangeLog')
-rw-r--r-- | gcc/fortran/ChangeLog | 884 |
1 files changed, 884 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 1c45bdb..d75d64f 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,887 @@ +2025-08-01 Mikael Morin <mikael@gcc.gnu.org> + + * trans-decl.cc (gfc_trans_deferred_vars): Fix closing brace in + a comment. + +2025-07-31 Mikael Morin <morin-mikael@orange.fr> + + PR fortran/121342 + * trans-expr.cc (gfc_conv_subref_array_arg): Remove offset + update. + (gfc_conv_procedure_call): For polymorphic functions, move the + scalarizer descriptor information... + * trans-array.cc (gfc_add_loop_ss_code): ... here, and evaluate + the bounds to fresh variables. + (get_class_info_from_ss): Remove offset update. + (gfc_conv_ss_startstride): Don't set a zero value for function + result upper bounds. + (late_set_loop_bounds): New. + (gfc_conv_loop_setup): If the bounds of a function result have + been set, and no other array provided loop bounds for a + dimension, use the function result bounds as loop bounds for + that dimension. + (gfc_set_delta): Don't skip delta setting for polymorphic + function results. + +2025-07-30 Mikael Morin <morin-mikael@orange.fr> + + * trans-array.cc (gfc_array_init_size): Remove the nelems + argument. + (gfc_array_allocate): Update caller. Remove the nelems + argument. + * trans-stmt.cc (gfc_trans_allocate): Update caller. Remove the + nelems variable. + * trans-array.h (gfc_array_allocate): Update prototype. + +2025-07-30 Yuao Ma <c8ef@outlook.com> + + * check.cc (gfc_check_split): Argument check for SPLIT. + * gfortran.h (enum gfc_isym_id): Define GFC_ISYM_SPLIT. + * intrinsic.cc (add_subroutines): Register SPLIT intrinsic. + * intrinsic.h (gfc_check_split): New decl. + (gfc_resolve_split): Ditto. + * intrinsic.texi: SPLIT documentation. + * iresolve.cc (gfc_resolve_split): Add resolved_sym for SPLIT. + * trans-decl.cc (gfc_build_intrinsic_function_decls): Add decl for + SPLIT in libgfortran. + * trans-intrinsic.cc (conv_intrinsic_split): SPLIT codegen. + (gfc_conv_intrinsic_subroutine): Handle SPLIT case. + * trans.h (GTY): Declare gfor_fndecl_string_split{, _char4}. + +2025-07-27 Mikael Morin <mikael@gcc.gnu.org> + + PR fortran/121185 + * trans-expr.cc (gfc_trans_assignment_1): Use the same condition + to set the is_alloc_lhs flag and to decide to generate + reallocation code. Add explicit call to gfc_fix_class_refs + before evaluating the condition. + +2025-07-27 Mikael Morin <mikael@gcc.gnu.org> + + PR fortran/121185 + * trans-array.cc (set_factored_descriptor_value): Also trigger + the saving of the previously selected reference on encountering + an INDIRECT_REF. Extract the saving code... + (save_ref): ... here as a new function. + +2025-07-27 Mikael Morin <mikael@gcc.gnu.org> + + PR fortran/121185 + * trans-expr.cc (gfc_get_class_from_expr): Give up class + container lookup on the second COMPONENT_REF after an array + descriptor. + +2025-07-25 David Malcolm <dmalcolm@redhat.com> + + * error.cc: Make diagnostics::context::m_source_printing private. + +2025-07-25 David Malcolm <dmalcolm@redhat.com> + + * cpp.cc: Update usage of "diagnostic_info" to explicitly refer to + "diagnostics::diagnostic_info". + * error.cc: Likewise. + +2025-07-25 David Malcolm <dmalcolm@redhat.com> + + * cpp.cc: Update for diagnostic_t becoming + enum class diagnostics::kind. + * error.cc: Likewise. + * options.cc: Likewise. + +2025-07-25 David Malcolm <dmalcolm@redhat.com> + + * cpp.cc: Update for renaming of + diagnostic_option_id to diagnostics::option_id. + +2025-07-25 David Malcolm <dmalcolm@redhat.com> + + * error.cc: Update for move of diagnostic-color.h to + diagnostics/color.h. + +2025-07-25 David Malcolm <dmalcolm@redhat.com> + + * error.cc: Update for diagnostic_context becoming + diagnostics::context. + +2025-07-25 David Malcolm <dmalcolm@redhat.com> + + * error.cc: Update to add "m_" prefix to fields of + diagnostic_info throughout. + +2025-07-25 David Malcolm <dmalcolm@redhat.com> + + * error.cc: Update for move of diagnostics output formats into + namespace "diagnostics" as "sinks". + * gfortran.h: Likewise. + +2025-07-23 Harald Anlauf <anlauf@gmx.de> + + PR fortran/121203 + * trans-expr.cc (gfc_conv_procedure_call): Obtain the character + length of an assumed character length procedure from the typespec + of the actual argument even if there is no explicit interface. + +2025-07-21 Mikael Morin <mikael@gcc.gnu.org> + + * trans-decl.cc (gfc_trans_deferred_vars): Fix indentation. + +2025-07-21 Andre Vehreschild <vehre@gcc.gnu.org> + + PR fortran/119106 + * expr.cc (simplify_constructor): Do not simplify constants. + (gfc_simplify_expr): Continue to simplify expression when an + iterator is present. + +2025-07-21 Mikael Morin <mikael@gcc.gnu.org> + + * trans-array.cc (gfc_conv_ss_descriptor): Move the descriptor + expression initialisation... + (set_factored_descriptor_value): ... to this new function. + Before initialisation, walk the reference expression passed as + argument and save some of its subexpressions to a variable. + (substitute_t): New struct. + (maybe_substitute_expr): New function. + (substitute_subexpr_in_expr): New function. + +2025-07-18 Harald Anlauf <anlauf@gmx.de> + + PR fortran/121145 + * trans-expr.cc (gfc_conv_procedure_call): Do not create pointer + check for proc-pointer actual passed to optional dummy. + +2025-07-16 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/121060 + * interface.cc (matching_typebound_op): Defer determination of + specific procedure until resolution by returning NULL. + +2025-07-16 Steve Kargl <sgk@troutmask.apl.washington.edu> + + * decl.cc (gfc_match_import): Correct minor whitespace snafu + and fix NULL pointer dereferences in two places. + +2025-07-15 Kwok Cheung Yeung <kcyeung@baylibre.com> + + PR fortran/104428 + * trans-openmp.cc (gfc_trans_omp_declare_variant): Check that proc_st + is non-NULL before dereferencing. Add line number to error message. + +2025-07-15 Mikael Morin <mikael@gcc.gnu.org> + + * gfortran.h (gfc_symbol): Remove field allocated_in_scope. + * trans-array.cc (gfc_array_allocate): Don't set it. + (gfc_alloc_allocatable_for_assignment): Likewise. + Generate the unallocated descriptor bounds initialisation + before the opening of the reallocation code block. Create a + variable and use it as additional condition to the unallocated + descriptor bounds initialisation. + +2025-07-15 Mikael Morin <mikael@gcc.gnu.org> + + * trans-array.cc (gfc_conv_ss_descriptor): Don't evaluate + offset and data to a variable if is_alloc_lhs is set. Move the + existing evaluation decision condition for data... + (save_descriptor_data): ... here as a new predicate. + (evaluate_bound): Add argument save_value. Omit the evaluation + of the value to a variable if that argument isn't set. + (gfc_conv_expr_descriptor): Update caller. + (gfc_conv_section_startstride): Update caller. Set save_value + if is_alloc_lhs is not set. Omit the evaluation of stride to a + variable if save_value isn't set. + (gfc_set_delta): Omit the evaluation of delta to a variable + if is_alloc_lhs is set. + (gfc_is_reallocatable_lhs): Return false if flag_realloc_lhs + isn't set. + (gfc_alloc_allocatable_for_assignment): Don't update + the variables that may be stored in saved_offset, delta, and + data. Call instead... + (update_reallocated_descriptor): ... this new procedure. + * trans-expr.cc (gfc_trans_assignment_1): Don't omit setting the + is_alloc_lhs flag if the right hand side is an intrinsic + function. Clear the flag if the right hand side is scalar. + +2025-07-15 Mikael Morin <mikael@gcc.gnu.org> + + * trans-expr.cc (gfc_trans_assignment_1): Generate array + reallocation code before entering the scalarisation loops. + +2025-07-15 Filip Kastl <fkastl@suse.cz> + + * resolve.cc (resolve_select_type): Fix indentation. + +2025-07-12 Tobias Burnus <tburnus@baylibre.com> + + * invoke.texi (-Wsurprising): Note about OpenACC warning + related to PARAMATER. + * openmp.cc (resolve_omp_clauses, gfc_resolve_oacc_declare): + Accept PARAMETER for OpenACC but add surprising warning. + * trans-openmp.cc (gfc_trans_omp_variable_list, + gfc_trans_omp_clauses): Ignore PARAMETER inside clauses. + +2025-07-11 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/106135 + * decl.cc (build_sym): Emit an error if a symbol associated by + an IMPORT, ONLY or IMPORT, all statement is being redeclared. + (gfc_match_import): Parse and check the F2018 versions of the + IMPORT statement. For scopes other than and interface body, if + the symbol cannot be found in the host scope, generate it and + set it up such that gfc_fixup_sibling_symbols can transfer its + 'imported attribute' if it turnes out to be a not yet parsed + procedure. Test for violations of C897-8100. + * gfortran.h : Add 'import_only' to the gfc_symtree structure. + Add the enum, 'importstate', which is used for values the new + field 'import_state' in gfc_namespace. + * parse.cc (gfc_fixup_sibling_symbols): Transfer the attribute + 'imported' to the new symbol. + * resolve.cc (check_sym_import_status, check_import_status): + New functions to test symbols and expressions for violations of + F2018:C8102. + (resolve_call): Test the 'resolved_sym' against C8102 by a call + to 'check_sym_import_status'. + (gfc_resolve_expr): If the expression is OK and an IMPORT + statement has been registered in the current scope, test C102 + by calling 'check_import_status'. + (resolve_select_type): Test the declared derived type in TYPE + IS and CLASS IS statements. + +2025-07-08 Andre Vehreschild <vehre@gcc.gnu.org> + + PR fortran/120637 + * class.cc (finalize_component): Return true, when a finalizable + component was detect and do not free it. + +2025-07-07 Mikael Morin <mikael@gcc.gnu.org> + + * trans-intrinsic.cc (conv_intrinsic_move_alloc): Add pre and + post code for the FROM and TO arguments. + +2025-07-04 Martin Jambor <mjambor@suse.cz> + + * io.cc (format_asterisk): Add a brace around static initialization + location part of the field locus. + +2025-07-03 Andre Vehreschild <vehre@gcc.gnu.org> + + PR fortran/120843 + * resolve.cc (resolve_operator): Remove conformability check, + because it is not in the standard. + +2025-07-01 Harald Anlauf <anlauf@gmx.de> + + * coarray.cc (check_add_new_component): Treat pure and elemental + intrinsic functions the same as non-intrinsic ones. + (create_caf_add_data_parameter_type): Fix front-end memleaks. + * trans-intrinsic.cc (conv_caf_func_index): Likewise. + +2025-07-01 Andre Vehreschild <vehre@gcc.gnu.org> + + PR fortran/120847 + * coarray.cc (check_add_new_comp_handle_array): Make the count + of components static to be able to create more than one. Create + an array component only for array expressions. + +2025-07-01 Andre Vehreschild <vehre@gcc.gnu.org> + + PR fortran/120843 + * resolve.cc (resolve_operator): Report inconsistent coranks + only when not referencing this_image. + (gfc_op_rank_conformable): Treat coranks as inconformable only + when a coindex other then implicit this_image is used. + +2025-06-27 Harald Anlauf <anlauf@gmx.de> + + PR fortran/120784 + * interface.cc (gfc_match_end_interface): Detect empty local_name. + +2025-06-26 Martin Jambor <mjambor@suse.cz> + + * match.cc (gfc_match_nullify): Initialize p to NULL; + +2025-06-26 Andre Vehreschild <vehre@gcc.gnu.org> + + * trans.cc (gfc_allocate_using_malloc): Prevent possible memory + leak when allocation was already done. + +2025-06-26 Andre Vehreschild <vehre@gcc.gnu.org> + + * resolve.cc (resolve_fl_derived0): Do not create the token + component when not in coarray lib mode. + * trans-types.cc: Do not access the token when not in coarray + lib mode. + +2025-06-26 Andre Vehreschild <vehre@gcc.gnu.org> + + PR fortran/120711 + * trans-array.cc (gfc_trans_array_ctor_element): Store the value + of the offset for reuse. + +2025-06-24 Tobias Burnus <tburnus@baylibre.com> + + * trans-stmt.cc (gfc_trans_call_acc_attach_detach): New. + (gfc_trans_call): Call it. + +2025-06-24 Harald Anlauf <anlauf@gmx.de> + Jerry DeLisle <jvdelisle@gcc.gnu.org> + Mikael Morin <mikael@gcc.gnu.org> + + PR fortran/120743 + * trans-expr.cc (gfc_conv_substring): Substring indices are of + type gfc_charlen_type_node. Convert to size_type_node for + pointer arithmetic only after offset adjustments have been made. + +2025-06-24 Mikael Morin <morin-mikael@orange.fr> + + * misc.cc (gfc_var_name_for_select_type_temp): New function. + * gfortran.h (gfc_var_name_for_select_type_temp): Declare it. + * resolve.cc (resolve_select_type): Pick a discriminating name + from the SELECT TYPE variable reference and use it in the name + of the temporary variable that is generated. Truncate name to + the buffer size. + * match.cc (select_type_set_tmp): Likewise. Pass the + discriminating name... + (select_intrinsic_set_tmp): ... to this function. Use the + discriminating name likewise. Augment the buffer size to match + that of select_type_set_tmp and resolve_select_type. + +2025-06-23 Tobias Burnus <tburnus@baylibre.com> + + * openmp.cc (OACC_WAIT_CLAUSES): Add if clause. + * trans-openmp.cc (gfc_trans_oacc_wait_directive): Handle it. + +2025-06-23 Harald Anlauf <anlauf@gmx.de> + + PR fortran/120784 + * interface.cc (gfc_match_end_interface): If a use-associated + symbol is renamed, use the local_name for checking. + +2025-06-19 Mikael Morin <mikael@gcc.gnu.org> + + PR fortran/120713 + * trans-array.cc (gfc_trans_deferred_array): Statically + initialize deferred length variable for SAVEd character arrays. + +2025-06-18 Harald Anlauf <anlauf@gmx.de> + + PR fortran/82480 + * check.cc (gfc_check_fstat): Extend checks to INTENT(OUT) arguments. + (gfc_check_fstat_sub): Likewise. + (gfc_check_stat): Likewise. + (gfc_check_stat_sub): Likewise. + * intrinsic.texi: Adjust documentation. + +2025-06-16 Harald Anlauf <anlauf@gmx.de> + + PR fortran/51961 + * resolve.cc (conformable_arrays): Use modified rank check when + MOLD= expression is given. + +2025-06-12 Yuao Ma <c8ef@outlook.com> + Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/113152 + * intrinsic.texi: Document new half-revolution trigonometric + functions. Reorder doc for atand. + +2025-06-06 Tobias Burnus <tburnus@baylibre.com> + Sandra Loosemore <sloosemore@baylibre.com> + + * f95-lang.cc (ATTR_PURE_NOTHROW_LIST): Define. + * trans-expr.cc (get_builtin_fn): Handle omp_get_num_devices + and omp_get_intrinsic_device. + * gfortran.h (gfc_option_t): Add disable_omp_... for them. + * options.cc (gfc_handle_option): Handle them with + -fno-builtin-. + +2025-06-04 Andre Vehreschild <vehre@gcc.gnu.org> + + PR fortran/120483 + * trans-expr.cc (gfc_conv_substring): Use pointer arithmetic on + static allocatable char arrays. + +2025-06-03 Harald Anlauf <anlauf@gmx.de> + + PR fortran/99838 + * data.cc (gfc_assign_data_value): For a new initializer use the + location from the constructor as fallback. + +2025-05-30 Harald Anlauf <anlauf@gmx.de> + + PR fortran/102599 + PR fortran/114022 + * expr.cc (simplify_complex_array_inquiry_ref): Helper function for + simplification of inquiry references (%re/%im) of constant complex + arrays. + (find_inquiry_ref): Use it for handling %re/%im inquiry references + of complex arrays. + (scalarize_intrinsic_call): Fix frontend memleak. + * primary.cc (gfc_match_varspec): When the reference is NULL, the + previous simplification has succeeded in evaluating inquiry + references also of arrays. + +2025-05-30 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/120355 + * interface.cc (compare_parameter): If the global function has a + result clause, take typespec from there for the comparison against + the dummy argument. + +2025-05-30 Julian Brown <julian@codesourcery.com> + Tobias Burnus <tburnus@baylibre.com> + + * parse.cc (tree.h, fold-const.h, tree-hash-traits.h): Add includes + (for additions to omp-general.h). + +2025-05-29 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/120049 + * check.cc(check_c_ptr_2): Rephrase error message + for clarity. + +2025-05-28 Tobias Burnus <tburnus@baylibre.com> + + PR fortran/113152 + * simplify.cc (gfc_simplify_cospi, gfc_simplify_sinpi): Avoid using + mpfr_fmod_ui in the MPFR < 4.2.0 version. + +2025-05-28 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/119856 + * io.cc: Set missing comma error checks to STD_STD_LEGACY. + +2025-05-28 Yuao Ma <c8ef@outlook.com> + Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/113152 + * gfortran.h (enum gfc_isym_id): Add new enum. + * intrinsic.cc (add_functions): Register new intrinsics. Changing the call + from gfc_resolve_trigd{,2} to gfc_resolve_trig{,2}. + * intrinsic.h (gfc_simplify_acospi, gfc_simplify_asinpi, + gfc_simplify_asinpi, gfc_simplify_atanpi, gfc_simplify_atan2pi, + gfc_simplify_cospi, gfc_simplify_sinpi, gfc_simplify_tanpi): New. + (gfc_resolve_trig): Rename from gfc_resolve_trigd. + (gfc_resolve_trig2): Rename from gfc_resolve_trigd2. + * iresolve.cc (gfc_resolve_trig): Rename from gfc_resolve_trigd. + (gfc_resolve_trig2): Rename from gfc_resolve_trigd2. + * mathbuiltins.def: Add 7 new math builtins and re-align. + * simplify.cc (gfc_simplify_acos, gfc_simplify_asin, + gfc_simplify_acosd, gfc_simplify_asind): Revise error message. + (gfc_simplify_acospi, gfc_simplify_asinpi, + gfc_simplify_asinpi, gfc_simplify_atanpi, gfc_simplify_atan2pi, + gfc_simplify_cospi, gfc_simplify_sinpi, gfc_simplify_tanpi): New. + +2025-05-27 Harald Anlauf <anlauf@gmx.de> + + PR fortran/101735 + * primary.cc (gfc_match_varspec): Correct order of logic. + +2025-05-27 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/120049 + * check.cc (gfc_check_c_associated): Use new helper functions. + Only call check_c_ptr_1 if optional c_ptr_2 tests succeed. + (check_c_ptr_1): Handle only c_ptr_1 checks. + (check_c_ptr_2): Expand checks for c_ptr_2 and handle cases + where there is no derived pointer in the gfc_expr and check + the inmod_sym_id only if it exists. + * misc.cc (gfc_typename): Handle the case for BT_VOID rather + than throw an internal error. + +2025-05-27 Harald Anlauf <anlauf@gmx.de> + + PR fortran/101735 + * expr.cc (find_inquiry_ref): If an inquiry reference applies to + a substring, use that, and calculate substring length if needed. + * primary.cc (extend_ref): Also handle attaching to end of + reference chain for appending. + (gfc_match_varspec): Discrimate between arrays of character and + substrings of them. If a substring is taken from a character + component of a derived type, get the proper typespec so that + inquiry references work correctly. + (gfc_match_rvalue): Handle corner case where we hit a seemingly + dangling '%' and missed an inquiry reference. Try another match. + +2025-05-27 David Malcolm <dmalcolm@redhat.com> + + PR other/116792 + * error.cc (gfc_diagnostic_start_span): Update for diagnostic.h + changes. + +2025-05-19 Harald Anlauf <anlauf@gmx.de> + + PR fortran/120099 + * trans-types.cc (gfc_return_by_reference): Intrinsic functions + returning complex numbers may return their result by reference + with -ff2c. + +2025-05-15 Harald Anlauf <anlauf@gmx.de> + + PR fortran/85750 + * resolve.cc (resolve_symbol): Reorder conditions when to apply + default-initializers. + +2025-05-15 Tobias Burnus <tburnus@baylibre.com> + + * trans-openmp.cc (gfc_omp_deep_mapping_do): Handle SSA_NAME if + a def_stmt is available. + +2025-05-14 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/120139 + * dump-parse-tree.cc (get_c_type_name): If no constant + size of an array exists, output an asterisk. + +2025-05-14 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/120107 + * dump-parse-tree.cc (write_type): Do not dump non-interoperable + types. + +2025-05-14 Tobias Burnus <tburnus@baylibre.com> + + PR fortran/120225 + * simplify.cc (gfc_simplify_cotand): Fix used argument in + mpfr_tanu call. + +2025-05-14 Tobias Burnus <tburnus@baylibre.com> + + PR fortran/120225 + * simplify.cc: Include "trigd_fe.inc" only with MPFR < 4.2.0. + (rad2deg, rad2deg): Only define if MPFR < 4.2.0. + (gfc_simplify_acosd, gfc_simplify_asind, gfc_simplify_atand, + gfc_simplify_atan2d, gfc_simplify_cosd, gfc_simplify_tand, + gfc_simplify_cotand): Use mpfr_...u functions with MPFR >= 4.2.0. + +2025-05-13 Yuao Ma <c8ef@outlook.com> + Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/113413 + * intrinsic.cc (do_check): Minor doc polish. + (add_functions): Add atand(y, x) mapping. + * intrinsic.texi: Update atand example. + +2025-05-13 Jakub Jelinek <jakub@redhat.com> + Daniil Kochergin <daniil2472s@gmail.com> + Tobias Burnus <tburnus@baylibre.com> + + PR fortran/120191 + * trans-intrinsic.cc (strip_kind_from_actual): Remove. + (gfc_conv_intrinsic_minmaxloc): Don't call strip_kind_from_actual. + Free and clear kind_arg->expr if non-NULL. Set back_arg->name to + "%VAL" instead of a loop looking for last argument. Remove actual + variable, use array_arg instead. Free and clear dim_arg->expr if + non-NULL for BT_CHARACTER cases instead of using a loop. + +2025-05-11 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/120163 + * gfortran.h: Add formal_resolved to gfc_symbol. + * resolve.cc (gfc_resolve_formal_arglist): Set it. + (resolve_function): Do not call gfc_get_formal_from_actual_arglist + if we already resolved a formal arglist. + (resolve_call): Likewise. + +2025-05-10 Harald Anlauf <anlauf@gmx.de> + + PR fortran/102891 + * dependency.cc (gfc_ref_needs_temporary_p): Within an array + reference, inquiry references of complex variables generally + need a temporary. + +2025-05-10 Jakub Jelinek <jakub@redhat.com> + + PR fortran/120193 + * trans-types.cc (gfc_init_types): For flag_unsigned use + build_distinct_type_copy or build_variant_type_copy from + gfc_character_types[index_char] if index_char > -1 instead of + gfc_character_types[index_char] or + gfc_build_unsigned_type (&gfc_unsigned_kinds[index]). + +2025-05-08 Harald Anlauf <anlauf@gmx.de> + + PR fortran/120179 + * match.cc (gfc_match_do): Do not attempt to match end-of-statement + twice. + +2025-05-07 Paul Thomas <pault@gcc.gnu.org> + and Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/119948 + * primary.cc (match_variable): Module procedures with sym the + same as result can be treated as variables, although marked + external. + +2025-05-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/120049 + * check.cc (gfc_check_c_associated): Modify checks to avoid + ICE and allow use, intrinsic :: iso_c_binding from a separate + module file. + +2025-05-06 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/119928 + * interface.cc (gfc_check_dummy_characteristics): Do not issue + error if one dummy symbol has been generated from an actual + argument and the other one has OPTIONAL, INTENT, ALLOCATABLE, + POINTER, TARGET, VALUE, ASYNCHRONOUS or CONTIGUOUS. + (gfc_get_formal_from_actual_arglist): Do nothing if symbol + is a class. + +2025-05-04 Harald Anlauf <anlauf@gmx.de> + + PR fortran/119986 + * expr.cc (is_subref_array): When searching for array references, + do not terminate early so that inquiry references to complex + components work. + * primary.cc (gfc_variable_attr): A substring reference can refer + to either a scalar or array character variable. Adjust search + accordingly. + +2025-05-01 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/119948 + * resolve.cc (gfc_impure_variable): The result of a module + procedure with an interface declaration is not impure even if + the current namespace is not the same as the symbol's. + +2025-04-25 Harald Anlauf <anlauf@gmx.de> + + PR fortran/102900 + * trans-decl.cc (gfc_generate_function_code): Use sym->result + when generating fake result decl for functions returning + allocatable or pointer results. + * trans-expr.cc (gfc_conv_procedure_call): When checking the + pointer status of an actual argument passed to a non-allocatable, + non-pointer dummy which is of type CLASS, do not check the + class container of the actual if it is just a procedure pointer. + (gfc_trans_pointer_assignment): Fix treatment of assignment to + NULL of a procedure pointer. + +2025-04-23 Andre Vehreschild <vehre@gcc.gnu.org> + + PR fortran/119200 + * check.cc (gfc_check_lcobound): Use locus from intrinsic_where. + (gfc_check_image_index): Same. + (gfc_check_num_images): Same. + (gfc_check_team_number): Same. + (gfc_check_this_image): Same. + (gfc_check_ucobound): Same. + +2025-04-22 Andre Vehreschild <vehre@gcc.gnu.org> + + * match.cc (match_exit_cycle): Allow to exit team block. + (gfc_match_end_team): Create end_team node also without + parameter list. + * trans-intrinsic.cc (conv_stat_and_team): Team and team_number + only need to be a single pointer. + * trans-stmt.cc (trans_associate_var): Create a mapping coarray + token for coarray associations or it is not addressed correctly. + * trans.h (enum gfc_coarray_regtype): Add mapping mode to + coarray register. + +2025-04-22 Andre Vehreschild <vehre@gcc.gnu.org> + + * check.cc (gfc_check_image_index): Check for team or + team_number correctnes. + (gfc_check_num_images): Same. + * gfortran.texi: Update documentation on num_images' API + function. + * intrinsic.cc (add_functions): Update signature of image_index + and num_images. Both can take either a team handle or number. + * intrinsic.h (gfc_check_num_images): Update signature to take + either team or team_number. + (gfc_check_image_index): Can take coarray, subscripts and team + or team number now. + (gfc_simplify_image_index): Same. + (gfc_simplify_num_images): Same. + (gfc_resolve_image_index): Same. + * intrinsic.texi: Update documentation of num_images() Fortran + function. + * iresolve.cc (gfc_resolve_image_index): Update signature. + * simplify.cc (gfc_simplify_num_images): Update signature and + remove undocumented failed argument. + (gfc_simplify_image_index): Add team or team number argument. + * trans-intrinsic.cc (conv_stat_and_team): Because being + optional teams need to be a pointer to the opaque pointer. + (conv_caf_sendget): Correct call; was two arguments short. + (trans_image_index): Support team or team_number. + (trans_num_images): Same. + (conv_intrinsic_cobound): Adapt to changed signature of + num_images in call. + * trans-stmt.cc (gfc_trans_sync): Same. + +2025-04-22 Andre Vehreschild <vehre@gcc.gnu.org> + + PR fortran/87326 + * check.cc (gfc_check_this_image): Check the three different + parameter lists possible for this_image and sort them correctly. + * gfortran.texi: Update documentation on this_image's API. + * intrinsic.cc (add_functions): Update this_image's signature. + (check_specific): Add specific check for this_image. + * intrinsic.h (gfc_check_this_image): Change to flexible + argument list. + * intrinsic.texi: Update documentation on this_image(). + * iresolve.cc (gfc_resolve_this_image): Resolve the different + arguments. + * simplify.cc (gfc_simplify_this_image): Simplify the simplify + routine. + * trans-decl.cc (gfc_build_builtin_function_decls): Update + signature of this_image. + * trans-expr.cc (gfc_caf_get_image_index): Use correct signature + of this_image. + * trans-intrinsic.cc (trans_this_image): Adapt to correct + signature. + +2025-04-22 Andre Vehreschild <vehre@gcc.gnu.org> + + PR fortran/88154 + PR fortran/88960 + PR fortran/97210 + PR fortran/103001 + * check.cc (team_type_check): Check a type for being team_type + from the iso_fortran_env module. + (gfc_check_image_status): Use team_type check. + (gfc_check_get_team): Check for level argument. + (gfc_check_team_number): Use team_type check. + * expr.cc (gfc_check_assign): Add treatment for returning + team_type in caf-single mode. + * gfortran.texi: Add/Update documentation for get_team and + team_number API functions. + * intrinsic.cc (add_functions): Update get_team signature. + * intrinsic.h (gfc_resolve_get_team): Add prototype. + * intrinsic.texi: Add/Update documentation for get_team and + team_number Fortran functions. + * iresolve.cc (gfc_resolve_get_team): Resolve return type to be + of type team_type. + * iso-fortran-env.def: Update STAT_LOCK constants. They have + nothing to do with files. Add level constants for get_team. + * libgfortran.h: Add level and unlock_stat constants. + * simplify.cc (gfc_simplify_get_team): Simply to correct return + type team_type. + * trans-decl.cc (gfc_build_builtin_function_decls): Update + get_team and image_status API prototypes to correct signatures. + * trans-intrinsic.cc (conv_intrinsic_image_status): Translate + second parameter correctly. + (conv_intrinsic_team_number): Translate optional single team + argument correctly. + (gfc_conv_intrinsic_function): Add translation of get_team. + +2025-04-22 Andre Vehreschild <vehre@gcc.gnu.org> + + PR fortran/87326 + PR fortran/87556 + PR fortran/88254 + PR fortran/103796 + * coarray.cc (split_expr_at_caf_ref): Treat polymorphic types + correctly. Ensure resolve of expression after coindex. + (create_allocated_callback): Fix parameter of allocated function + for coarrays. + (coindexed_expr_callback): Improve detection of coarrays in + allocated function. + * decl.cc (gfc_match_end): Add team block matching. + * dump-parse-tree.cc (show_code_node): Dump change team block as + such. + * frontend-passes.cc (gfc_code_walker): Recognice team block. + * gfortran.texi: Add documentation for team api functions. + * intrinsic.texi: Add documentation about team_type in + iso_fortran_env module. + * iso-fortran-env.def (team_type): Use helper to get pointer + kind. + * match.cc (gfc_match_associate): Factor out matching of + association list, because it is used in change team as well. + (check_coarray_assoc): Ensure, that the association is to a + coarray. + (match_association_list): Match a list of association either in + associate or in change team. + (gfc_match_form_team): Match form team correctly include + new_index. + (gfc_match_change_team): Match change team with association + list. + (gfc_match_end_team): Match end team including stat and errmsg. + (gfc_match_return): Prevent return from team block. + * parse.cc (decode_statement): Sort team block. + (next_statement): Same. + (check_statement_label): Same. + (accept_statement): Same. + (verify_st_order): Same. + (parse_associate): Renamed to move_associates_to_block... + (move_associates_to_block): ... to enable reuse for change team. + (parse_change_team): Parse it as block. + (parse_executable): Same. + * parse.h (enum gfc_compile_state): Add team block as compiler + state. + * resolve.cc (resolve_scalar_argument): New function to resolve + an argument to a statement as a scalar. + (resolve_form_team): Resolve its members. + (resolve_change_team): Same. + (resolve_branch): Prevent branch from jumping out of team block. + (check_team): Removed. + * trans-decl.cc (gfc_build_builtin_function_decls): Add stat and + errmsg to team API functions and update their arguments. + * trans-expr.cc (gfc_trans_subcomponent_assign): Also null the + token when moving memory or an allocated() will not detect a + free. + * trans-intrinsic.cc (gfc_conv_intrinsic_caf_is_present_remote): + Adapt to signature change no longer a pointer-pointer. + * trans-stmt.cc (gfc_trans_form_team): Translate a form team + including new_index. + (gfc_trans_change_team): Translate a change team as a block. + +2025-04-22 Andre Vehreschild <vehre@gcc.gnu.org> + + PR fortran/87939 + * check.cc (gfc_check_move_alloc): Add stat and errmsg to + move_alloc. + * dump-parse-tree.cc (show_sync_stat): New helper function. + (show_code_node): Use show_sync_stat to print stat and errmsg. + * gfortran.h (struct sync_stat): New struct to unify stat and + errmsg handling. + * intrinsic.cc (add_subroutines): Correct signature of + move_alloc. + * intrinsic.h (gfc_check_move_alloc): Correct signature of + check_move_alloc. + * match.cc (match_named_arg): Match an optional argument to a + statement. + (match_stat_errmsg): Match a stat= or errmsg= named argument. + (gfc_match_critical): Use match_stat_errmsg to match the named + arguments. + (gfc_match_sync_team): Same. + * resolve.cc (resolve_team_argument): Resolve an expr to have + type TEAM_TYPE from iso_fortran_env. + (resolve_scalar_variable_as_arg): Resolve an argument as a + scalar type. + (resolve_sync_stat): Resolve stat and errmsg expressions. + (resolve_sync_team): Resolve a sync team statement using + sync_stat helper. + (resolve_end_team): Same. + (resolve_critical): Same. + * trans-decl.cc (gfc_build_builtin_function_decls): Correct + sync_team signature. + * trans-intrinsic.cc (conv_intrinsic_move_alloc): Store stat + an errmsg optional arguments in helper struct and use helper + to translate. + * trans-stmt.cc (trans_exit): Implement DRY pattern for + generating an _exit(). + (gfc_trans_sync_stat): Translate stat and errmsg contents. + (gfc_trans_end_team): Use helper to translate stat and errmsg. + (gfc_trans_sync_team): Same. + (gfc_trans_critical): Same. + * trans-stmt.h (gfc_trans_sync_stat): New function. + * trans.cc (gfc_deallocate_with_status): Parameterize check at + runtime to allow unallocated (co-)array when freeing a + structure. + (gfc_deallocate_scalar_with_status): Same and also add errmsg. + * trans.h (gfc_deallocate_with_status): Signature changes. + (gfc_deallocate_scalar_with_status): Same. + +2025-04-19 Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/119836 + * resolve.cc (check_pure_function): Fix checking for + an impure subprogram within a DO CONCURRENT construct. + (pure_subroutine): Ditto. + 2025-04-16 Harald Anlauf <anlauf@gmx.de> PR fortran/106948 |