2025-05-23  Release Manager

	* GCC 14.3.0 released.

2025-05-13  Jakub Jelinek  <jakub@redhat.com>

	Backported from master:
	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-12  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	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-04-30  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2025-04-16  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/106948
	* resolve.cc (gfc_pure_function): If a function has been resolved,
	but esym is not yet set, look at its attributes to see whether it
	is pure or elemental.

2025-04-14  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2025-04-09  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/119656
	* interface.cc (gfc_compare_actual_formal): Fix front-end memleak
	when searching for matching interfaces.
	* trans-expr.cc (gfc_conv_procedure_call): If there is a formal
	dummy corresponding to an absent argument, use its type, and only
	fall back to inferred type otherwise.

2025-04-03  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/119380
	* trans-array.cc (structure_alloc_comps): Prevent freeing of
	procedure pointer components.

2025-03-27  Jakub Jelinek  <jakub@redhat.com>

	Backported from master:
	2025-03-22  Jakub Jelinek  <jakub@redhat.com>

	* resolve.cc (resolve_procedure_expression): Remove extraneous space
	from the middle of diagnostics.

2025-03-25  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2025-03-19  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/116706
	* trans-array.cc (gfc_is_reallocatable_lhs): Fix check on
	allocatable components of derived type or class objects.

2025-03-10  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2025-01-27  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/118640
	* resolve.cc (generate_component_assignments): Make sure that
	the rhs temporary does not pick up the optional attribute from
	the lhs.

2025-03-09  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-11-16  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/109066
	* resolve.cc (generate_component_assignments): If the temporary
	for 'var' is a pointer and 'expr' is neither a constant or
	a variable, change its attribute from pointer to allocatable.
	This avoids assignment to a temporary point that has neither
	been allocated or associated.

2025-03-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	Backported from master:
	2025-03-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/119054
	* resolve.cc (resolve_elemental_actual): When checking other
	actual arguments to elemental procedures, don't check
	attributes of literals and function calls.

2025-03-09  Andre Vehreschild  <vehre@gcc.gnu.org>

	Backported from master:
	2025-03-04  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/103391
	* trans-expr.cc (gfc_trans_assignment_1): Do not use poly assign
	for pointer arrays on lhs (as it is done for allocatables
	already).

2025-02-22  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2025-02-15  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/118080
	* gfortran.texi: Adjust documentation.
	* trans-decl.cc (create_function_arglist): Adjust to pass hidden
	presence flag also for derived type dummies with VALUE,OPTIONAL
	attribute.
	* trans-expr.cc (gfc_conv_expr_present): Expect hidden presence
	flag also for derived type dummies with VALUE,OPTIONAL attribute.
	(conv_cond_temp): Adjust to allow derived types.
	(conv_dummy_value): Extend to handle derived type dummies with
	VALUE,OPTIONAL attribute.
	(gfc_conv_procedure_call): Adjust for actual arguments passed to
	derived type dummies with VALUE,OPTIONAL attribute.
	* trans-types.cc (gfc_get_function_type): Adjust fndecl for
	hidden presence flag.

2025-02-14  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2025-02-07  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/59252
	* trans-expr.cc (gfc_trans_subcomponent_assign): Initialize
	allocatable non-deferred character with NULL properly.

2025-02-07  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2025-02-06  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/118750
	* resolve.cc (resolve_assoc_var): If the target expression has
	a rank, do not use gfc_expression_rank, since it will return 0
	if the function is elemental. Resolution will have produced the
	correct rank.

2025-02-07  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2025-01-11  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/108434
	* class.cc (generate_finalization_wrapper): To avoid memory
	leaks from callocs, return immediately if the derived type
	error flag is set.
	* decl.cc (build_struct): If the declaration of a derived type
	or class component does not have a deferred arrayspec, correct,
	set the error flag of the derived type and emit an immediate
	error.

2025-02-06  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2025-01-31  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/108454
	* resolve.cc (resolve_common_blocks): Initialize variable.
	(resolve_symbol): If a symbol is already registered with a COMMON
	block, do not search for an interface with the same name.

2025-02-04  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-11-06  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/117434
	* interface.cc (gfc_compare_actual_formal): Skip 'Expected a
	procedure pointer error' if the formal argument typespec has an
	interface and the type of the actual arg is BT_PROCEDURE.

2025-01-31  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2025-01-27  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/110993
	* frontend-passes.cc (check_externals_procedure): Do not compare
	interfaces of a non-bind(C) procedure against a bind(C) global one.
	(check_against_globals): Use local name from rename-on-use in the
	search for interfaces.

2025-01-29  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2025-01-29  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/118683
	* trans-expr.cc (gfc_conv_procedure_call): The bounds update for
	passing to assumed-rank dummies shall also handle component
	references besides inquiry references.

2025-01-24  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2025-01-20  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/81978
	* trans-array.cc (gfc_conv_array_parameter): Do not copy back data
	if actual array parameter has the PARAMETER attribute.
	* trans-expr.cc (gfc_conv_subref_array_arg): Likewise.

2025-01-10  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2025-01-03  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/106692
	* trans-expr.cc (gfc_conv_expr_op): Inhibit excessive optimization
	of Cray pointers by treating them as volatile in comparisons.

2024-12-22  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-12-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/117797
	* trans-array.cc (class_array_element_size): New function.
	(gfc_get_array_span): Refactor, using class_array_element_size
	to return the span for descriptors that are the _data component
	of a class expression and then class dummy references. Revert
	the conditions to those before r15-5083 tidying up using 'sym'.

2024-12-17  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-12-15  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/117897
	* trans-expr.cc (gfc_trans_assignment_1): RHS pointer function
	results must not be finalized.

2024-12-15  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/117730
	PR fortran/84674
	* class.cc (add_proc_comp): If the present typebound procedure
	component is abstract, unconditionally check the replacement.
	Only reject a non_overridable if it has no overridden procedure
	and the component is already present in the vtype.

2024-12-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	Backported from master:
	2024-08-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/109105
	* resolve.cc (CHECK_INTERFACES): New helper macro.
	(resolve_operator): Replace use of snprintf with
	gfc_error.

2024-12-06  Andrew Pinski  <quic_apinski@quicinc.com>

	Backported from master:
	2024-11-29  Andrew Pinski  <quic_apinski@quicinc.com>

	PR fortran/117843
	* trans-io.cc (gfc_trans_transfer): Add default case.

2024-12-06  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2024-11-28  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/117791
	* trans-io.cc (gfc_trans_transfer): When an array index depends on
	a function evaluation or an expression, do not use optimized array
	I/O of an array section and fall back to normal scalarization.

2024-12-02  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2024-11-26  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/117774
	* trans-expr.cc (gfc_conv_procedure_call): When passing an array
	to an assumed-rank dummy, terminate search for array reference of
	actual argument before an inquiry reference (e.g. INQUIRY_RE,
	INQUIRY_IM) so that bounds update works properly.

2024-11-30  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-11-13  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/105054
	* resolve.cc (get_temp_from_expr): If the pointer function has
	a deferred character length, generate a new deferred charlen
	for the temporary.

2024-11-27  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-11-26  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/117763
	* trans-array.cc (gfc_get_array_span): Guard against derefences
	of 'expr'. Clean up some typos. Use 'gfc_get_vptr_from_expr'
	for clarity and apply a functional reversion of last section
	that deals with class dummies.

2024-11-24  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/84869
	* trans-expr.cc (trans_class_vptr_len_assignment): To access
	the '_len' field, 're' must be unlimited polymorphic.

2024-11-23  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-11-11  Tomas Trnka  <trnka@scm.com>
		    Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/116388
	* class.cc (finalize_component): Leading underscore in the name
	of 'byte_stride' to suppress invalid finalization.

2024-11-23  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-11-11  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/109345
	* trans-array.cc (gfc_get_array_span): Unlimited polymorphic
	expressions are now treated separately since the span need not
	be the same as the element size.

2024-11-22  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2024-11-14  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/104819
	* trans-expr.cc (conv_null_actual): Helper function to handle
	passing of NULL() to non-optional dummy arguments of non-bind(c)
	procedures.
	(gfc_conv_procedure_call): Use it for character dummies.

2024-11-14  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-11-01  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/115700
	* resolve.cc (resolve_assoc_var): Extract a substring reference
	with missing as well as non-constant start or end.

2024-11-14  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-10-31  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/115700
	* resolve.cc (resolve_variable): The typespec of an expression,
	which is not a substring, can be shared with a deferred length
	associate name.
	(resolve_assoc_var): Extract a substring reference with non-
	constant start or end. Use it to flag up the need for array
	associate name to be a pointer.
	(resolve_block_construct): Change comment from past to future
	tense.

2024-11-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/115070
	PR fortran/115348
	* trans-expr.cc (gfc_trans_class_init_assign): If all the
	components of the default initializer are null for a scalar,
	build an empty statement to prevent prior declarations from
	disappearing.

2024-11-01  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-10-25  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/79685
	* decl.cc (match_data_constant): Find the symtree instead of
	the symbol so the use renamed symbols are found. Pass this and
	the derived type to gfc_match_structure_constructor.
	* match.h: Update prototype of gfc_match_structure_contructor.
	* primary.cc (gfc_match_structure_constructor): Remove call to
	gfc_get_ha_sym_tree and use caller supplied symtree instead.

2024-10-25  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-07-16  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/84868
	* simplify.cc (gfc_simplify_len_trim): If the argument is an
	element of a parameter array, simplify all the elements and
	build a new parameter array to hold the result, after checking
	that it doesn't already exist.
	* trans-expr.cc (gfc_get_interface_mapping_array) if a string
	length is available, use it for the typespec.
	(gfc_add_interface_mapping): Supply the se string length.

2024-09-20  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2024-09-05  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/100273
	* trans-decl.cc (gfc_create_module_variable): Handle module
	variable also when it is needed for the result specification
	of a contained function.

2024-08-30  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2024-08-29  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/116530
	* trans-io.cc (transfer_namelist_element): Prevent NULL pointer
	dereference.

2024-08-06  Jakub Jelinek  <jakub@redhat.com>

	Backported from master:
	2024-08-01  Jakub Jelinek  <jakub@redhat.com>

	* trans-types.cc (gfc_get_array_descr_info): Don't test if
	!integer_zerop (dtype_off), use fold_build_pointer_plus
	unconditionally.

2024-08-05  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-07-18  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/108889
	* gfortran.h: Add bit field 'allocated_in_scope' to gfc_symbol.
	* trans-array.cc (gfc_array_allocate): Set 'allocated_in_scope'
	after allocation if not a component reference.
	(gfc_alloc_allocatable_for_assignment): If 'allocated_in_scope'
	not set, not a component ref and not allocated, set the array
	bounds and offset to give zero length in all dimensions. Then
	set allocated_in_scope.

2024-08-01  Release Manager

	* GCC 14.2.0 released.

2024-07-20  Paul Thomas  <pault@gcc.gnu.org>

	Revert:
	2024-07-19  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/59104
	* dependency.cc (dependency_fcn, gfc_function_dependency): New
	functions to detect dependency in array bounds and character
	lengths on old style function results.
	* dependency.h : Add prototype for gfc_function_dependency.
	* error.cc (error_print): Remove trailing space.
	* gfortran.h : Remove dummy_order and add fn_result_spec.
	* symbol.cc : Remove declaration of next_dummy_order..
	(gfc_set_sym_referenced): remove setting of symbol dummy order.
	* trans-array.cc (gfc_trans_auto_array_allocation): Detect
	non-dummy symbols with function dependencies and put the
	allocation at the end of the initialization code.
	* trans-decl.cc : Include dependency.h.
	(decl_order): New function that determines uses the location
	field of the symbol 'declared_at' to determine the order of two
	declarations.
	(gfc_defer_symbol_init): Call gfc_function_dependency to put
	dependent symbols in the right part of the tlink chain. Use
	the location field of the symbol declared_at to determine the
	order of declarations.
	(gfc_trans_auto_character_variable): Put character length
	initialization of dependent symbols at the end of the chain.
	* trans.cc (gfc_add_init_cleanup): Add boolean argument with
	default false that determines whther an expression is placed at
	the back or the front of the initialization chain.
	* trans.h : Update the prototype for gfc_add_init_cleanup.

2024-07-19  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-05-13  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/113363
	* trans-array.cc (gfc_array_init_size): Use the expr3 dtype so
	that the correct element size is used.
	* trans-expr.cc (gfc_conv_procedure_call): Remove restriction
	that ss and ss->loop be present for the finalization of class
	array function results.
	(trans_class_assignment): Use free and malloc, rather than
	realloc, for character expressions assigned to unlimited poly
	entities.
	* trans-stmt.cc (gfc_trans_allocate): Build a correct rhs for
	the assignment of an unlimited polymorphic 'source'.

2024-07-19  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-06-20  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/59104
	* dependency.cc (dependency_fcn, gfc_function_dependency): New
	functions to detect dependency in array bounds and character
	lengths on old style function results.
	* dependency.h : Add prototype for gfc_function_dependency.
	* error.cc (error_print): Remove trailing space.
	* gfortran.h : Remove dummy_order and add fn_result_spec.
	* symbol.cc : Remove declaration of next_dummy_order..
	(gfc_set_sym_referenced): remove setting of symbol dummy order.
	* trans-array.cc (gfc_trans_auto_array_allocation): Detect
	non-dummy symbols with function dependencies and put the
	allocation at the end of the initialization code.
	* trans-decl.cc : Include dependency.h.
	(decl_order): New function that determines uses the location
	field of the symbol 'declared_at' to determine the order of two
	declarations.
	(gfc_defer_symbol_init): Call gfc_function_dependency to put
	dependent symbols in the right part of the tlink chain. Use
	the location field of the symbol declared_at to determine the
	order of declarations.
	(gfc_trans_auto_character_variable): Put character length
	initialization of dependent symbols at the end of the chain.
	* trans.cc (gfc_add_init_cleanup): Add boolean argument with
	default false that determines whther an expression is placed at
	the back or the front of the initialization chain.
	* trans.h : Update the prototype for gfc_add_init_cleanup.

2024-07-19  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2024-07-19  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103115
	* trans-array.cc (gfc_trans_array_constructor_value): If the first
	element of an array constructor is deferred-length character and
	therefore does not have an element size known at compile time, do
	not try to collect subsequent constant elements into a constructor
	for optimization.

2024-07-15  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2024-05-24  Harald Anlauf  <anlauf@gmx.de>
		    Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/93635
	* symbol.cc (conflict_std): Helper function for reporting attribute
	conflicts depending on the Fortran standard version.
	(conf_std): Helper macro for checking standard-dependent conflicts.
	(gfc_check_conflict): Use it.

2024-07-14  Mikael Morin  <mikael@gcc.gnu.org>

	Backported from master:
	2024-05-20  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/99798
	* symbol.cc (gfc_release_symbol): Move the condition guarding
	the handling cyclic references...
	(cyclic_reference_break_needed): ... here as a new predicate.
	Remove superfluous parts.  Add a condition preventing any premature
	release with submodule symbols.

2024-07-14  Mikael Morin  <mikael@gcc.gnu.org>

	Backported from master:
	2024-07-13  Mikael Morin  <mikael@gcc.gnu.org>

	* trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Add the
	preliminary code generated for MASK to the preliminary code of
	MINLOC/MAXLOC.

2024-07-12  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-05-23  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/103312
	* dependency.cc (gfc_dep_compare_expr): Handle component call
	expressions. Return -2 as default and return 0 if compared with
	a function expression that is from an interface body and has
	the same name.
	* expr.cc (gfc_reduce_init_expr): If the expression is a comp
	call do not attempt to reduce, defer to resolution and return
	false.
	* trans-types.cc (gfc_get_dtype_rank_type,
	gfc_get_nodesc_array_type): Fix whitespace.

2024-07-08  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-05-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/84006
	PR fortran/100027
	PR fortran/98534
	* iresolve.cc (gfc_resolve_transfer): Emit a TODO error for
	unlimited polymorphic mold.
	* trans-expr.cc (gfc_resize_class_size_with_len): Use the fold
	even if a block is not available in which to fix the result.
	(trans_class_assignment): Enable correct assignment of
	character expressions to unlimited polymorphic variables using
	lhs _len field and rse string_length.
	* trans-intrinsic.cc (gfc_conv_intrinsic_storage_size): Extract
	the class expression so that the unlimited polymorphic class
	expression can be used in gfc_resize_class_size_with_len to
	obtain the storage size for character payloads. Guard the use
	of GFC_DECL_SAVED_DESCRIPTOR by testing for DECL_LANG_SPECIFIC
	to prevent the ICE. Also, invert the order to use the class
	expression extracted from the argument.
	(gfc_conv_intrinsic_transfer): In same way as 'storage_size',
	use the _len field to obtaining the correct length for arg 1.
	Add a branch for the element size in bytes of class expressions
	with provision to make use of the unlimited polymorphic _len
	field. Again, the class references are explicitly identified.
	'mold_expr' was already declared. Use it instead of 'arg'. Do
	not fix 'dest_word_len' for deferred character sources because
	reallocation on assign makes use of it before it is assigned.

2024-07-07  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2024-07-03  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/115700
	* trans-stmt.cc (trans_associate_var): When the associate target
	is an array-valued character variable, the length is known at entry
	of the associate block.  Move setting of string length of the
	selector to the initialization part of the block.

2024-06-30  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2024-06-29  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/114019
	* trans-stmt.cc (gfc_trans_allocate): Fix handling of case of
	scalar character expression being used for SOURCE.

2024-06-30  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2024-06-24  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/55978
	* trans-array.cc (gfc_conv_array_parameter): Do not dereference
	data component of a missing allocatable dummy array argument for
	passing as actual to optional dummy.  Harden logic of presence
	check for optional pointer dummy by using TRUTH_ANDIF_EXPR instead
	of TRUTH_AND_EXPR.

2024-06-30  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2024-06-19  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/115390
	* trans-decl.cc (gfc_conv_cfi_to_gfc): Move derivation of type sizes
	for character via gfc_trans_vla_type_sizes to after character length
	has been set.

2024-06-08  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2024-06-04  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/83865
	* trans-stmt.cc (gfc_trans_allocate): Restrict special case for
	source-expression with zero-length character to rank 0, so that
	the array shape is not discarded.

2024-05-28  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2024-05-20  Tobias Burnus  <tburnus@baylibre.com>

	PR fortran/115150
	* trans-intrinsic.cc (gfc_conv_intrinsic_bound): Fix SHAPE
	for zero-size arrays

2024-05-25  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2024-05-24  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/86100
	* trans-array.cc (gfc_conv_ss_startstride): Use abridged_ref_name
	to generate a more user-friendly name for bounds-check messages.
	* trans-expr.cc (gfc_copy_class_to_class): Fix bounds check for
	rank>1 by looping over the dimensions.

2024-05-21  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2024-05-11  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/115039
	* expr.cc (gfc_traverse_expr): An inquiry ref does not constitute
	a dependency and cannot collide with a symbol.

2024-05-17  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-05-17  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/114874
	* gfortran.h: Add 'assoc_name_inferred' to gfc_namespace.
	* match.cc (gfc_match_select_type): Set 'assoc_name_inferred'
	in select type namespace if the selector has inferred type.
	* primary.cc (gfc_match_varspec): If a select type temporary
	is apparently scalar and a left parenthesis has been detected,
	check the current namespace has 'assoc_name_inferred' set. If
	so, set inferred_type.
	* resolve.cc (resolve_variable): If the namespace of a select
	type temporary is marked with 'assoc_name_inferred' call
	gfc_fixup_inferred_type_refs to ensure references are OK.
	(gfc_fixup_inferred_type_refs): Catch invalid array refs..

2024-05-09  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2024-05-05  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/114827
	* trans-array.cc (gfc_alloc_allocatable_for_assignment): Take into
	account _len of unlimited polymorphic entities when calculating
	the effective element size for allocation size and array span.
	Set _len of lhs to _len of rhs.
	* trans-expr.cc (trans_class_assignment): Take into account _len
	of unlimited polymorphic entities for allocation size.

2024-05-07  Release Manager

	* GCC 14.1.0 released.

2024-04-30  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	2024-04-29  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/114959
	* trans-expr.cc (gfc_trans_class_init_assign): Return NULL_TREE
	if the default initializer has all NULL fields. Guard this
	by a requirement that the code not be EXEC_INIT_ASSIGN and that
	the object be an INTENT_OUT dummy.
	* trans-stmt.cc (gfc_trans_allocate): Change the initializer
	code for allocate with mold to EXEC_ALLOCATE to allow an
	initializer with all NULL fields.

2024-04-25  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/93678
	* trans-expr.cc (gfc_conv_procedure_call): Use the interface,
	where possible, to obtain the type of character procedure
	pointers of class entities.

2024-04-25  Paul Thomas  <pault@gcc.gnu.org>
	    Jakub Jelinek  <jakub@gcc.gnu.org>

	PR fortran/89462
	* decl.cc (build_sym): Add an extra argument 'elem'. If 'elem'
	is greater than 1, gfc_new_charlen is called to generate a new
	charlen, registered in the symbol namespace.
	(variable_decl, enumerator_decl): Set the new argument in the
	calls to build_sym.

2024-04-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/103471
	* resolve.cc (resolve_actual_arglist): Catch variables silently
	set as untyped, resetting the flag so that gfc_resolve_expr can
	generate the no implicit type error.
	(gfc_resolve_index_1): Block index expressions of unknown type
	from being converted to default integer, avoiding the fatal
	error in trans-decl.cc.
	* symbol.cc (gfc_set_default_type): Remove '(symbol)' from the
	'no IMPLICIT type' error message.
	* trans-decl.cc (gfc_get_symbol_decl): Change fatal error locus
	to that of the symbol declaration.
	(gfc_trans_deferred_vars): Remove two trailing tabs.

2024-04-18  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/114739
	* primary.cc (gfc_match_varspec): Check for default type before
	checking for derived types with the right component name.

2024-04-16  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/113793
	* resolve.cc (resolve_allocate_expr): Reject ALLOCATE with SOURCE=
	or MOLD= specifier for unequal length.
	* trans-stmt.cc (gfc_trans_allocate): If an allocatable character
	variable has fixed length, use it and do not use the source length.
	With bounds-checking enabled, add a runtime check for same length.

2024-04-10  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/106500
	* check.cc (is_c_interoperable): Fix checks for C_SIZEOF.
	(gfc_check_c_f_pointer): Reject function returning a pointer as FPTR,
	and improve an error message.

2024-04-09  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/114535
	* resolve.cc (resolve_symbol): Remove last chunk that checked
	for finalization of unreferenced symbols.

2024-04-09  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/113956
	* trans-expr.cc (gfc_trans_pointer_assignment): Remove assert
	causing the ICE since it was unnecesary.

2024-04-02  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/106999
	* interface.cc (gfc_compare_interfaces): Add error for a
	subroutine proc pointer passed to a variable formal.
	(compare_parameter): If a procedure pointer is being passed to
	a non-procedure formal arg, and there is an an interface, use
	gfc_compare_interfaces to check and provide a more useful error
	message.

2024-04-02  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/112407
	* resolve.cc (resolve_procedure_expression): Change the test for
	for recursion in the case of hidden procedures from modules.
	(resolve_typebound_static): Add warning for possible recursive
	calls to typebound procedures.
	* trans-expr.cc (gfc_trans_class_init_assign): Do not apply
	default initializer to class dummy where component initializers
	are all null.

2024-03-29  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/50410
	* trans-expr.cc (gfc_conv_structure): Check for NULL pointer.

2024-03-29  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/36337
	PR fortran/110987
	PR fortran/113885
	* trans-expr.cc (gfc_trans_assignment_1): Place finalization
	block before rhs post block for elemental rhs.
	* trans.cc (gfc_finalize_tree_expr): Check directly if a type
	has no components, rather than the zero components attribute.
	Treat elemental zero component expressions in the same way as
	scalars.

2024-03-28  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/114474
	* primary.cc (gfc_variable_attr): Catch variables used in structure
	constructors within DATA statements that are still tagged with a
	temporary type BT_PROCEDURE from match_actual_arg and which have the
	target attribute, and fix their typespec.

2024-03-28  Mikael Morin  <mikael@gcc.gnu.org>
	    Harald Anlauf  <anlauf@gmx.de>

	PR fortran/111781
	PR fortran/114475
	* expr.cc (check_restricted): In submodules, allow variables host-
	associated from the parent module.

2024-03-22  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/55978
	* interface.cc (gfc_compare_actual_formal): Skip size check for
	NULL() actual without MOLD argument.

2024-03-22  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/107426
	* gfortran.h (gfc_save_module_list, gfc_restore_old_module_list):
	New declarations.
	* module.cc (old_module_list_tail): New global variable.
	(gfc_save_module_list, gfc_restore_old_module_list): New functions.
	(gfc_use_modules): Set module_list and old_module_list_tail.
	* parse.cc (next_statement): Save module_list before doing any work.
	(reject_statement): Restore module_list to its saved value.

2024-03-22  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/111781
	* symbol.cc (gfc_get_procedure_ns, gfc_get_spec_ns): New functions.
	* gfortran.h (gfc_get_procedure_ns, gfc_get_spec ns): Declare them.
	(gfc_is_formal_arg): Remove.
	* expr.cc (check_restricted): Remove special case allowing local
	variable in dummy argument bound expressions.  Use gfc_get_spec_ns
	to get the right namespace.
	* resolve.cc (gfc_is_formal_arg, formal_arg_flag): Remove.
	(gfc_resolve_formal_arglist): Set gfc_current_ns.  Quit loop and
	restore gfc_current_ns instead of early returning.
	(resolve_symbol): Factor common array spec resolution code to...
	(resolve_symbol_array_spec): ... this new function.  Additionnally
	set and restore gfc_current_ns.

2024-03-21  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/30802
	* trans-array.cc (abridged_ref_name): New helper function.
	(trans_array_bound_check): Use it.
	(array_bound_check_elemental): Likewise.
	(gfc_conv_array_ref): Likewise.

2024-03-20  Jakub Jelinek  <jakub@redhat.com>

	* trans-array.cc (structure_alloc_comps): Use integer_zero_node
	instead of build_zero_cst (integer_type_node) or
	build_int_cst (integer_type_node, 0) and integer_one_node instead of
	build_int_cst (integer_type_node, 1).
	* trans-expr.cc (conv_scalar_char_value): Likewise.
	* trans-stmt.cc (gfc_trans_form_team, gfc_trans_change_team,
	gfc_trans_sync_team, gfc_trans_sync): Likewise.
	* trans-decl.cc (create_main_function): Likewise.
	* trans-intrinsic.cc (trans_this_image, conv_intrinsic_move_alloc):
	Likewise.
	* trans.cc (gfc_allocate_using_caf_lib, gfc_deallocate_with_status):
	Likewise.

2024-03-18  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103715
	* frontend-passes.cc (check_externals_expr): Prevent invalid read
	in case of mismatch of external subroutine with function.

2024-03-17  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/101135
	* trans-array.cc (gfc_get_dataptr_offset): Check for optional
	arguments being present before dereferencing data pointer.

2024-03-15  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/87477
	PR fortran/89645
	PR fortran/99065
	PR fortran/114141
	PR fortran/114280
	* class.cc (gfc_change_class): New function needed for
	associate names, when rank changes or a derived type is
	produced by resolution
	* dump-parse-tree.cc (show_code_node): Make output for SELECT
	TYPE more comprehensible.
	* expr.cc (find_inquiry_ref): Do not simplify expressions of
	an inferred type.
	* gfortran.h : Add 'gfc_association_list' to structure
	'gfc_association_list'. Add prototypes for
	'gfc_find_derived_types', 'gfc_fixup_inferred_type_refs' and
	'gfc_change_class'. Add macro IS_INFERRED_TYPE.
	* match.cc (copy_ts_from_selector_to_associate): Add bolean arg
	'select_type' with default false. If this is a select type name
	and the selector is a inferred type, build the class type and
	apply it to the associate name.
	(build_associate_name): Pass true to 'select_type' in call to
	previous.
	* parse.cc (parse_associate): If the selector is inferred type
	the associate name is too. Make sure that function selector
	class and rank, if known, are passed to the associate name. If
	a function result exists, pass its typespec to the associate
	name.
	* primary.cc (resolvable_fcns): New function to check that all
	the function references are resolvable.
	(gfc_match_varspec): If a scalar derived type select type
	temporary has an array reference, match the array reference,
	treating this in the same way as an equivalence member. Do not
	set 'inquiry' if applied to an unknown type the inquiry name
	is ambiguous with the component of an accessible derived type.
	Check that resolution of the target expression is OK by testing
	if the symbol is declared or is an operator expression, then
	using 'resolvable_fcns' recursively. If all is well, resolve
	the expression. If this is an inferred type with a component
	reference, call 'gfc_find_derived_types' to find a suitable
	derived type. If there is an inquiry ref and the symbol either
	is of unknown type or is inferred to be a derived type, set the
