2025-06-05  Release Manager

	* GCC 13.4.0 released.

2025-06-02  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-05-23  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-04-23  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-04-22  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-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-02-20  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-01-11  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.

2025-01-06  Paul Thomas  <pault@gcc.gnu.org>

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

	PR fortran/105152
	PR fortran/100193
	PR fortran/87496
	PR fortran/103389
	PR fortran/104429
	PR fortran/82774
	* interface.cc (gfc_compare_actual_formal): Emit an error if an
	unlimited polymorphic actual is not matched either to an
	unlimited or assumed type formal argument.
	* resolve.cc (resolve_ordinary_assign): Emit an error if the
	var expression of an ordinary assignment is a proc pointer
	component.
	* trans-array.cc (gfc_walk_array_ref): Provide assumed shape
	arrays coming from interface mapping with a viable arrayspec.
	* trans-expr.cc (gfc_conv_intrinsic_to_class): Tidy up flagging
	of unlimited polymorphic 'class_ts'.
	(gfc_conv_gfc_desc_to_cfi_desc): Assumed type is unlimited
	polymorphic and should accept any actual type.
	(gfc_conv_procedure_call): Replace dreadful kludge with a call
	to gfc_finalize_tree_expr. Avoid dereferencing a void pointer
	by giving it the pointer type of the actual argument.
	(alloc_scalar_allocatable_subcomponent): Shorten the function
	name and replace the symbol argument with the se string length.
	If a deferred length character length is either not present or
	is not a variable, give the typespec a variable and assign the
	string length to that. Use gfc_deferred_strlen to find the
	hidden string length component.
	(gfc_trans_subcomponent_assign): Convert the expression before
	the call to alloc_scalar_allocatable_subcomponent so that a
	good string length is provided.
	(gfc_trans_structure_assign): Remove the unneeded derived type
	symbol from calls to gfc_trans_subcomponent_assign.

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>

	Backported from master:
	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-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>

	Backported from master:
	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-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-14  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/115700
	* trans-stmt.cc (trans_associate_var): Update from mainline to
	handle substring targets correctly.

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-03  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/116040
	* trans-stmt.cc (trans_associate_var): Copy chunk in 14-branch
	that correctly handles class function selectors.

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-11-01  Paul Thomas  <pault@gcc.gnu.org>

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

	PR fortran/112459
	* trans-array.cc (gfc_trans_array_constructor_value): Replace
	gfc_notification_std with explicit logical expression that
	selects F2003/2008 and excludes -std=default/gnu.
	* trans-expr.cc (gfc_conv_expr): Ditto.

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-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-07-21  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-20  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-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-06-19  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-22  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-22  Andrew Jenner  <andrew@codesourcery.com>

	Backported from master:
	2023-11-28  Andrew Jenner  <andrew@codesourcery.com>
		    Tobias Burnus   <tobias@codesourcery.com>

	PR fortran/110415
	* trans-expr.cc (trans_class_vptr_len_assignment): Add
	from_vptrp parameter. Populate it. Don't check for DECL_P
	when deciding whether to create temporary.
	(trans_class_pointer_fcn, gfc_trans_pointer_assignment): Add
	NULL argument to trans_class_vptr_len_assignment calls.
	(trans_class_assignment): Get rhs_vptr from
	trans_class_vptr_len_assignment and use it for determining size
	for allocation/reallocation. Use return value from realloc.

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-21  Release Manager

	* GCC 13.3.0 released.

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

	Backported from master:
	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-05-08  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	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-05-08  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	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-05-08  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	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-05-06  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	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-05-06  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	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-05-06  Paul Thomas  <pault@gcc.gnu.org>

	Backported from master:
	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-05-06  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-26  Andre Vehreschild  <vehre@gcc.gnu.org>

	Backported from master:
	2023-07-12  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/102003
	* expr.cc (find_inquiry_ref): Replace len of pdt_string by
	constant.
	(simplify_ref_chain): Ensure input to find_inquiry_ref is
	NULL.
	(gfc_match_init_expr): Prevent PDT analysis for function calls.
	(gfc_pdt_find_component_copy_initializer): Get the initializer
	value for given component.
	* gfortran.h (gfc_pdt_find_component_copy_initializer): New
	function.
	* simplify.cc (gfc_simplify_len): Replace len() of PDT with pdt
	component ref or constant.

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

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

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

	PR fortran/103707
	PR fortran/106987
	* arith.cc (is_hard_arith_error): New helper function to determine
	whether an arithmetic error is "hard" or not.
	(check_result): Use it.
	(gfc_arith_divide): Set "Division by zero" only for regular
	numerators of real and complex divisions.
	(reduce_unary): Use is_hard_arith_error to determine whether a hard
	or (recoverable) soft error was encountered.  Terminate immediately
	on hard error, otherwise remember code of first soft error.
	(reduce_binary_ac): Likewise.
	(reduce_binary_ca): Likewise.
	(reduce_binary_aa): Likewise.

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

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

	PR fortran/113799
	* arith.cc (reduce_unary): Remember any overflow encountered during
	reduction of unary arithmetic operations on array constructors and
	continue, and return error status, but terminate on serious errors.

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

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

	PR fortran/95374
	PR fortran/104352
	* decl.cc (add_init_expr_to_sym): Set shape of initializer also for
	zero-sized arrays, so that bounds violations can be detected later.

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

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

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

	PR fortran/113866
	* trans-expr.cc (gfc_conv_procedure_call): When passing an optional
	dummy argument to an optional dummy argument of a bind(c) procedure
	and the dummy argument is passed via a CFI descriptor, no special
	presence check and passing of a default NULL pointer is needed.

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

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

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

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

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

	PR fortran/103716
	* resolve.cc (gfc_resolve_ref): Conversion of array_ref into an
	element should be done for all characters without a len expr,
	not just deferred lens, and for integer expressions.
	* trans-expr.cc (conv_inquiry): For len and kind inquiry refs,
	set the se string_length to NULL_TREE.

2024-03-23  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-23  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-23  Harald Anlauf  <anlauf@gmx.de>

	* trans-types.cc (gfc_get_nodesc_array_type): Clear used gmp
	variables.

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

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

	PR fortran/114001
	* expr.cc (gfc_is_simply_contiguous): Adjust logic so that CLASS
	symbols are also handled.

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

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

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

	PR fortran/110826
	* array.cc (gfc_array_dimen_size): When walking the ref chain of an
	array and the ultimate component is a procedure pointer, do not try
	to figure out its dimension even if it is a array-valued function.

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

	Backported from master:
	2023-12-05  Harald Anlauf  <anlauf@gmx.de>
		    Tobias Burnus   <tobias@codesourcery.com>

	PR fortran/100988
	* gfortran.h (IS_PROC_POINTER): New macro.
	* trans-types.cc (gfc_sym_type): Use macro in determination if the
	restrict qualifier can be used for a dummy variable.  Fix logic to
	allow the restrict qualifier also for optional arguments, and to
	not apply it to pointer or proc_pointer arguments.

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

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

	PR fortran/104819
	* check.cc (gfc_check_null): Handle nested NULL()s.
	(is_c_interoperable): Check for MOLD argument of NULL() as part of
	the interoperability check.
	* interface.cc (gfc_compare_actual_formal): Extend checks for NULL()
	actual arguments for presence of MOLD argument when required by
	Interp J3/22-146.

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

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

	PR fortran/114012
	* trans-expr.cc (gfc_conv_procedure_call): Evaluate non-trivial
	arguments just once before assigning to an unlimited polymorphic
	dummy variable.

2024-03-06  Steve Kargl  <kargl@gcc.gnu.org>

	Backported from master:
	2024-02-23  Steve Kargl  <kargl@gcc.gnu.org>
		    Harald Anlauf  <anlauf@gmx.de>

	PR fortran/114024
	* trans-stmt.cc (gfc_trans_allocate): When a source expression has
	substring references, part-refs, or %re/%im inquiries, wrap the
	entity in parentheses to force evaluation of the expression.

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

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

	PR fortran/104908
	* trans-array.cc (gfc_conv_array_ref): Restrict use of transformed
	descriptor (sym->backend_decl) to the unlimited polymorphic case.

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

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

	PR fortran/67277
	* trans-intrinsic.cc (gfc_conv_intrinsic_ishftc): Handle optional
	dummy argument for SIZE passed to ISHFTC.  Set default value to
	BIT_SIZE(I) when missing.

2023-12-27  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2023-12-17  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/97592
	* trans-expr.cc (gfc_conv_procedure_call): For a contiguous dummy
	with the TARGET attribute, the effective argument may still be
	contiguous even if the actual argument is not simply-contiguous.
	Allow packing to be decided at runtime by _gfortran_internal_pack.

2023-12-10  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2023-12-02  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/93762
	PR fortran/100651
	* trans-array.cc (gfc_trans_deferred_array): Add presence check
	for optional deferred-length character dummy arguments.
	* trans-expr.cc (gfc_conv_missing_dummy): The character length for
	deferred-length dummy arguments is passed by reference, so that
	its value can be returned.  Adjust handling for optional dummies.

2023-11-30  Harald Anlauf  <anlauf@gmx.de>

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

	PR fortran/111880
	* resolve.cc (resolve_common_vars): Do not call gfc_add_in_common
	for symbols that are USE associated or used in a submodule.

2023-11-30  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2023-11-30  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/112764
	* primary.cc (gfc_variable_attr): Set TARGET attribute of associating
	entity dependent on TARGET or POINTER attribute of selector.

2023-11-04  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2023-11-03  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/97245
	* match.cc (gfc_match_call): If a procedure pointer has already been
	resolved, do not create a new symbol in a procedure reference of
	the same name shadowing the first one if it is host-associated.

2023-11-03  Paul Thomas  <pault@gcc.gnu.org>

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

	PR fortran/112316
	* parse.cc (parse_associate): Remove condition that caused this
	regression.

2023-10-26  Paul Thomas  <pault@gcc.gnu.org>

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

	PR fortran/67740
	* trans-expr.cc (gfc_trans_pointer_assignment): Set the hidden
	string length component for pointer assignment to character
	pointer components.

2023-10-21  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2023-10-17  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/111837
	* frontend-passes.cc (traverse_io_block): Dependency check of loop
	nest shall be triangular, not banded.

2023-10-04  Paul Thomas  <pault@gcc.gnu.org>

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

	PR fortran/37336
	PR fortran/111674
	* trans-expr.cc (gfc_trans_scalar_assign): Finalize components
	on deallocation if derived type is not finalizable.

2023-09-30  Andre Vehreschild  <vehre@gcc.gnu.org>

	* trans-array.cc (gfc_trans_deferred_array): Use correct
	position for statements to add to guarded block.

2023-09-29  Andre Vehreschild  <vehre@gcc.gnu.org>

	Backported from master:
	2023-09-29  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/37336
	* trans-array.cc (structure_alloc_comps): Deref coarray.
	(gfc_trans_deferred_array): Add freeing of components after
	check for allocated coarray.

2023-09-24  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/92586
	* trans-expr.cc (gfc_trans_arrayfunc_assign): Supply a missing
	dereference for the call to gfc_deallocate_alloc_comp_no_caf.

2023-09-24  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/68155
	* decl.cc (fix_initializer_charlen): New function broken out of
	add_init_expr_to_sym.
	(add_init_expr_to_sym, build_struct): Call the new function.

2023-08-27  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/87477
	* parse.cc (parse_associate): Replace the existing evaluation
	of the target rank with calls to gfc_resolve_ref and
	gfc_expression_rank. Identify untyped target function results
	with structure constructors by finding the appropriate derived
	type.
	* resolve.cc (resolve_symbol): Allow associate variables to be
	assumed shape.

2023-08-09  Steve Kargl  <sgk@troutmask.apl.washington.edu>

	PR fortran/109684
	* resolve.cc (resolve_types): Exclude contained procedures with
	the artificial attribute from test for pureness.

2023-07-30  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2023-07-28  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/110825
	* gfortran.texi: Clarify argument passing convention.
	* trans-expr.cc (gfc_conv_procedure_call): Do not pass the character
	length as hidden argument when the declared dummy argument is
	assumed-type.

2023-07-30  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/108961
	* trans-expr.cc (gfc_conv_procedure_call): The hidden string
	length must not be passed to a formal arg of type(cptr).

2023-07-27  Release Manager

	* GCC 13.2.0 released.

2023-07-18  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2023-07-17  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/95947
	PR fortran/110658
	* trans-expr.cc (gfc_conv_procedure_call): For intrinsic procedures
	whose result characteristics depends on the first argument and which
	can be of type character, the character length will not be deferred.

2023-07-14  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2023-07-11  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/110288
	* symbol.cc (gfc_copy_formal_args_intr): When deriving the formal
	argument attributes from the actual ones for intrinsic procedure
	calls, take special care of CHARACTER arguments that we do not
	wrongly treat them formally as deferred-length.

2023-07-08  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2023-07-08  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/110585
	* arith.cc (gfc_compare_expr): Handle equality comparison of constant
	complex gfc_expr arguments.

2023-06-29  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2023-06-13  Harald Anlauf  <anlauf@gmx.de>
		    Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/86277
	* trans-array.cc (gfc_trans_allocate_array_storage): When passing a
	zero-sized array with fixed (= non-dynamic) size, allocate temporary
	by the caller, not by the callee.

2023-06-09  Jakub Jelinek  <jakub@redhat.com>

	Backported from master:
	2023-06-09  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/96024
	* primary.cc (gfc_convert_to_structure_constructor): Only do
	constant string ctor length verification and truncation/padding
	if constant length has INTEGER type.

2023-06-03  Steve Kargl  <kargl@gcc.gnu.org>

	Backported from master:
	2023-06-02  Steve Kargl  <kargl@gcc.gnu.org>

	PR fortran/100607
	* resolve.cc (resolve_select_rank): Remove duplicate error.
	(resolve_fl_var_and_proc): Prevent NULL pointer dereference and
	suppress error message for temporary.

2023-05-18  Harald Anlauf  <anlauf@gmx.de>

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

	PR fortran/109846
	* expr.cc (gfc_check_vardef_context): Check appropriate pointer
	attribute for CLASS vs. non-CLASS function result in variable
	definition context.

2023-05-18  Harald Anlauf  <anlauf@gmx.de>

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

	PR fortran/109641
	* arith.cc (eval_intrinsic): Check conformability of ranks of operands
	for intrinsic binary operators before performing type conversions.
	* gfortran.h (gfc_op_rank_conformable): Add prototype.
	* resolve.cc (resolve_operator): Check conformability of ranks of
	operands for intrinsic binary operators before performing type
	conversions.
	(gfc_op_rank_conformable): New helper function to compare ranks of
	operands of binary operator.

2023-05-05  Julian Brown  <julian@codesourcery.com>

	Backported from master:
	2023-05-04  Julian Brown  <julian@codesourcery.com>

	PR fortran/109622
	* openmp.cc (resolve_omp_clauses): Add diagnostic for
	non-pointer/non-allocatable attach/detach.
	* trans-openmp.cc (gfc_trans_omp_clauses): Remove dereference for
	pointer-to-scalar derived type component attach/detach.  Fix
	attach/detach handling for descriptors.

2023-05-05  Julian Brown  <julian@codesourcery.com>

	Backported from master:
	2023-04-28  Julian Brown  <julian@codesourcery.com>

	PR fortran/109622
	* trans-openmp.cc (gfc_trans_omp_clauses): Attach/detach clause fixes.

2023-04-26  Release Manager

	* GCC 13.1.0 released.

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

	PR fortran/109511
	* simplify.cc (gfc_simplify_set_exponent): Fix implementation of
	compile-time simplification of intrinsic SET_EXPONENT for argument
	X < 1 and for I < 0.

2023-04-14  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/104272
	* gfortran.h : Add expr3_not_explicit bit field to gfc_code.
	* resolve.cc (resolve_allocate_expr): Set bit field when the
	default initializer is applied to expr3.
	* trans-stmt.cc (gfc_trans_allocate): If expr3_not_explicit is
	set, do not deallocate expr3.

2023-04-13  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/109492
	* trans-expr.cc (gfc_conv_power_op): Use absu_hwi and
	unsigned HOST_WIDE_INT for portability.

2023-04-12  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/104312
	* resolve.cc (resolve_entries): Handle functions with ENTRY and
	ALLOCATABLE results.
	* trans-expr.cc (gfc_conv_procedure_call): Functions with a result
	with the POINTER or ALLOCATABLE attribute shall not get any special
	treatment with -ff2c, as they cannot be written in Fortran 77.
	* trans-types.cc (gfc_return_by_reference): Likewise.
	(gfc_get_function_type): Likewise.

2023-04-12  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/61615
	PR fortran/99982
	* interface.cc (compare_parameter): Enable type and rank checks for
	arguments of derived type from the intrinsic module ISO_C_BINDING.

2023-04-08  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/87477
	* iresolve.cc (gfc_resolve_adjustl, gfc_resolve_adjustr): if
	string length is deferred use the string typespec for result.
	* resolve.cc (resolve_assoc_var): Handle parentheses around the
	target expression.
	(resolve_block_construct): Remove unnecessary static decls.
	* trans-array.cc (gfc_conv_expr_descriptor): Guard string len
	expression in condition. Improve handling of string length and
	span, especially for substrings of the descriptor.
	(duplicate_allocatable): Make element type more explicit with
	'eltype'.
	* trans-decl.cc (gfc_get_symbol_decl): Emit a fatal error with
	appropriate message instead of ICE if symbol type is unknown.
	(gfc_generate_function_code): Set current locus to proc_sym
	declared_at.
	* trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
	'previous' and use if end expression in substring reference is
	null.
	(gfc_conv_string_length): Use gfc_conv_expr_descriptor if
	'expr_flat' is an array. Add post block to catch deallocation
	of temporaries.
	(gfc_conv_procedure_call): Assign the parmse string length to
	the expression string length, if it is deferred.
	(gfc_trans_alloc_subarray_assign): If this is a deferred string
	length component, store the string length in the hidden comp.
	Update the typespec length accordingly. Generate a new type
	spec for the call to gfc_duplicate-allocatable in this case.
	* trans-io.cc (gfc_trans_transfer): Scalarize transfer of
	deferred character array components.

2023-04-04  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/104349
	* expr.cc (check_restricted): Adjust check for valid variables in
	restricted expressions: make no exception for module variables.

2023-04-01  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* dump-parse-tree.cc (get_c_type_name): Fix "long_long"
	type name to be "long long".

2023-03-30  Andrew Pinski  <apinski@marvell.com>

	* dump-parse-tree.cc (get_c_type_name): Fix "long_long"
	type name to be "long long". Add a comment on why adding
	2 to the name too.

2023-03-28  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/109314
	* openmp.cc (gfc_omp_absent_contains_clause): Fix typo in diagnostics
	- composit -> composite.

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

	PR fortran/104321
	* trans-decl.cc (gfc_conv_cfi_to_gfc): Remove dead code.

2023-03-24  Harald Anlauf  <anlauf@gmx.de>

	* expr.cc (free_expr0): Free also BOZ strings as part of an expression.

2023-03-24  Haochen Gui  <guihaoc@gcc.gnu.org>
	    Tobias Burnus  <tobias@codesourcery.com>

	PR target/103628
	* target-memory.cc (gfc_interpret_float): Return FAIL when
	native_interpret_expr gets a NULL tree.
	* arith.cc (gfc_hollerith2real): Return NULL when
	gfc_interpret_float fails.
	* error.cc (gfc_buffered_p): Define.
	* gfortran.h (gfc_buffered_p): Declare.
	* intrinsic.cc: Add diagnostic.h to include list.
	(do_simplify): Save errorcount and check it at finish.  Report a
	"Cannot simplify expression" error on a bad result if error count
	doesn't change and no other errors buffered.

2023-03-22  Harald Anlauf  <anlauf@gmx.de>
	    Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/104572
	* resolve.cc (gfc_resolve_finalizers): Argument of a FINAL subroutine
	cannot be an alternate return.

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

	PR fortran/99036
	* decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a
	generic module interface.

2023-03-21  Arsen Arsenović  <arsen@aarsen.me>

	* invoke.texi: Remove usages of @gol.
	* intrinsic.texi: Ditto.

2023-03-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/109206
	* trans-array.cc (gfc_trans_array_constructor_value): Correct
	incorrect setting of typespec.

2023-03-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/109209
	* resolve.cc (generate_component_assignments): Restore the
	exclusion of allocatable components from the loop.

2023-03-20  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/109216
	* invoke.texi: Correct documentation of how underscores are appended
	to external names.

2023-03-20  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/109186
	* simplify.cc (gfc_simplify_nearest): Fix off-by-one error in setting
	up real kind-specific maximum exponent for mpfr.

2023-03-20  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/87127
	* resolve.cc (check_host_association): If an external function
	is typed but not declared explicitly to be external, change the
	old symbol from a variable to an external function.

2023-03-19  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/85877
	* resolve.cc (resolve_fl_procedure): Check for an explicit interface
	of procedures with the BIND(C) attribute (F2018:15.4.2.2).

2023-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* gfortran.texi: Mention behavior on overflow.

2023-03-18  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/103854
	PR fortran/96122
	PR fortran/37336
	* class.cc (finalize_component): Include the missing arguments
	in the call to the component's finalizer wrapper.
	(has_finalizer_component): Do not return true for procedure
	pointer components.
	(finalizer_insert_packed_call): Remove the redundant argument
	in the call to the final subroutine.
	(generate_finalization_wrapper): Add support for assumed rank
	finalizers.
	(gfc_may_be_finalized): New helper function.
	* dump-parse-tree.cc (write_proc): Whitespace.
	* gfortran.h : Add prototype for gfc_may_be_finalized.
	* resolve.cc (resolve_function): Correct derived types that
	have an incomplete namespace.
	(resolve_where, gfc_resolve_where_code_in_forall,
	gfc_resolve_forall_body, gfc_resolve_code): Check that the op
	code is still EXEC_ASSIGN. If it is set lhs to must finalize.
	(is_finalizable_type): New function.
	(generate_component_assignments): Set must_finalize if needed.
	(gfc_resolve_finalizers): Error if assumed rank finalizer is
	not the only one. Warning on lack of scalar finalizer modified
	to account for assumed rank finalizers.
	(generate_final_call): New function.
	(generate_component_assignments): Enclose the outermost call in
	a block to capture automatic deallocation and final calls.
	Set must_finalize as required to satisfy the standards. Use an
	explicit pointer assignment for pointer components to capture
	finalization of the target. Likewise use explicit assignment
	for allocatable components. Do not use the temporary copy of
	the lhs in defined assignment if the component is allocatable.
	Put the temporary in the same namespace as the lhs symbol if
	the component may be finalized. Remove the leading assignment
	from the expansion of assignment of components that have their
	own defined assignment components. Suppress finalization of
	assignment of temporary components to the lhs. Make an explicit
	final call for the rhs function temporary if it exists.
	(gfc_resolve_code): Set must_finalize for assignments with an
	array constructor on the rhs.
	(gfc_resolve_finalizers): Ensure that an assumed rank finalizer
	is the only finalizer for that type and correct the surprising
	warning for the lack of a scalar finalizer.
	(check_defined_assignments): Handle allocatable components.
	(resolve_fl_derived): Set referenced the vtab for use
	associated symbols.
	(resolve_symbol): Set referenced an unreferenced symbol that
	will be finalized.
	* trans-array.cc (gfc_trans_array_constructor_value): Add code
	to finalize the constructor result. Warn that this feature was
	removed in F2018 and that it is suppressed by -std=2018.
	(trans_array_constructor): Add finalblock, pass to previous
	and apply to loop->post if filled.
	(gfc_add_loop_ss_code): Add se finalblock to outer loop post.
	(gfc_trans_array_cobounds, gfc_trans_array_bounds): Add any
	generated finalization code to the main block.
	(structure_alloc_comps): Add boolean argument to suppress
	finalization and use it for calls from
	gfc_deallocate_alloc_comp_no_caf. Otherwise it defaults to
	false.
	(gfc_copy_alloc_comp_no_fini): New wrapper for
	structure_alloc_comps.
	(gfc_alloc_allocatable_for_assignment): Suppress finalization
	by setting new arg in call to gfc_deallocate_alloc_comp_no_caf.
	(gfc_trans_deferred_array): Use gfc_may_be_finalized and do not
	deallocate the components of entities with a leading '_' in the
	name that are also marked as artificial.
	* trans-array.h : Add the new boolean argument to the prototype
	of gfc_deallocate_alloc_comp_no_caf with a default of false.
	Add prototype for gfc_copy_alloc_comp_no_fini.
	* trans-decl.cc(init_intent_out_dt): Tidy up the code.
	* trans-expr.cc (gfc_init_se): Initialize finalblock.
	(gfc_conv_procedure_call): Use gfc_finalize_tree_expr to
	finalize function results. Replace in-line block for class
	results with call to new function.
	(gfc_conv_expr): Finalize structure constructors for F2003 and
	F2008. Warn that this feature was deleted in F2018 and, unlike
	array constructors, is not default. Add array constructor
	finalblock to the post block.
	(gfc_trans_scalar_assign): Suppress finalization by setting new
	argument in call to gfc_deallocate_alloc_comp_no_caf. Add the
	finalization blocks to the main block.
	(gfc_trans_arrayfunc_assign): Use gfc_assignment_finalizer_call
	and ensure that finalization occurs after the evaluation of the
	rhs but using the initial value for the lhs. Finalize rhs
	function results using gfc_finalize_tree_expr.
	(trans_class_assignment, gfc_trans_assignment_1): As previous
	function, taking care to order evaluation, assignment and
	finalization correctly.
	* trans-io.cc (gfc_trans_transfer): Add the final block.
	* trans-stmt.cc (gfc_trans_call, gfc_trans_allocate): likewise.
	(trans_associate_var): Nullify derived allocatable components
	and finalize function targets with defined assignment
	components on leaving the block scope.
	(trans_allocate): Finalize source expressions, if required,
	and set init_expr artificial temporarily to suppress the
	finalization in gfc_trans_assignment.
	* trans.cc (gfc_add_finalizer_call): Do not finalize the
	temporaries generated in type assignment with defined
	assignment components.
	(gfc_assignment_finalizer_call): New function.
	(gfc_finalize_tree_expr): New function.
	* trans.h: Add finalblock to gfc_se. Add the prototypes for
	gfc_finalize_tree_expr and gfc_assignment_finalizer_call.

2023-03-15  Harald Anlauf  <anlauf@gmx.de>
	    Tobias Burnus  <tobias@codesourcery.com>

	PR fortran/58331
	* interface.cc (compare_parameter): Adjust check of array dummy
	arguments to handle the case of CLASS variables.

2023-03-11  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/106945
	* trans-expr.cc (gfc_copy_class_to_class): Convert element counts in
	bounds check to common type for comparison.

2023-03-10  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/104332
	* resolve.cc (resolve_symbol): Avoid NULL pointer dereference while
	checking a symbol with the BIND(C) attribute.

2023-03-05  Harald Anlauf  <anlauf@gmx.de>
	    Tobias Burnus   <tobias@codesourcery.com>

	PR fortran/106856
	* class.cc (gfc_build_class_symbol): Handle update of attributes of
	existing class container.
	(gfc_find_derived_vtab): Fix several memory leaks.
	(find_intrinsic_vtab): Ditto.
	* decl.cc (attr_decl1): Manage update of symbol attributes from
	CLASS attributes.
	* primary.cc (gfc_variable_attr): OPTIONAL shall not be taken or
	updated from the class container.
	* symbol.cc (free_old_symbol): Adjust management of symbol versions
	to not prematurely free array specs while working on the declation
	of CLASS variables.

2023-03-01  Tobias Burnus  <tobias@codesourcery.com>

	PR middle-end/108546
	* trans-openmp.cc (gfc_trans_omp_clauses): Fix mapping of
	type(C_ptr) variables.

2023-02-27  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/108937
	* trans-intrinsic.cc (gfc_conv_intrinsic_ibits): Handle corner case
	LEN argument of IBITS equal to BITSIZE(I).

2023-02-25  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/108923
	* intrinsic.cc (get_intrinsic_dummy_arg,
	set_intrinsic_dummy_arg): Rename the former to the latter.
	Remove the return value, add a reference to the lhs as argument,
	and do the pointer assignment inside the function.  Don't do
	it if the pointer is already non-NULL.
	(sort_actual): Update caller.

2023-02-25  Harald Anlauf  <anlauf@gmx.de>

	* arith.cc (gfc_real2int): Clear mpfr variable after use.

2023-02-25  Tobias Burnus  <tobias@codesourcery.com>

	PR fortran/108621
	* trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Skip setting of
	bounds of CFI desc for 'pointer,intent(out)'.

2023-02-24  Rimvydas Jasinskas  <rimvydas.jas@gmail.com>

	* trans-decl.cc (gfc_finish_var_decl): Apply attribute.
	(generate_local_decl): Add diagnostic for dummy and local variables.

2023-02-24  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/108923
	* expr.cc (gfc_free_actual_arglist): Free associated_dummy
	memory.
	(gfc_copy_actual_arglist): Make a copy of the associated_dummy
	field if it is set in the original element.

2023-02-24  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/108924
	* frontend-passes.cc (do_subscript): Clear used gmp variable.

2023-02-23  Arsen Arsenović  <arsen@aarsen.me>

	* invoke.texi: Reorder index entries around @items.

2023-02-23  Arsen Arsenović  <arsen@aarsen.me>

	* invoke.texi: Reorder @opindex commands to precede @items they
	relate to.

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

	PR fortran/96024
	* resolve.cc (resolve_component): The type of a CHARACTER length
	expression must be INTEGER.

2023-02-21  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/96025
	* parse.cc (check_function_result_typed): Improve type check of
	specification expression for character length and return status.
	(parse_spec): Use status from above.
	* resolve.cc (resolve_fntype): Prevent use of invalid specification
	expression for character length.

2023-02-16  Patrick Palka  <ppalka@redhat.com>

	* gfortran.h: Mechanically drop static from static inline
	functions via s/^static inline/inline/g.

2023-02-15  Steve Kargl  <kargl@gcc.gnu.org>

	PR fortran/103608
	* frontend-passes.cc (do_intent): Catch NULL pointer dereference on
	reference to invalid formal argument.

2023-02-15  Steve Kargl  <kargl@gcc.gnu.org>

	PR fortran/104554
	* resolve.cc (check_assumed_size_reference): Avoid NULL pointer
	dereference.

2023-02-15  Tobias Burnus  <tobias@codesourcery.com>

	PR fortran/108512
	* openmp.cc (gfc_resolve_omp_parallel_blocks): Handle combined 'loop'
	directives.
	(gfc_resolve_do_iterator): Set a source location for added
	'private'-clause arguments.
	* resolve.cc (gfc_resolve_code): Call gfc_resolve_omp_do_blocks
	also for EXEC_OMP_LOOP and gfc_resolve_omp_parallel_blocks for
	combined directives with loop + '{masked,master} taskloop (simd)'.

2023-02-13  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103475
	* primary.cc (gfc_expr_attr): Avoid NULL pointer dereference for
	invalid use of CLASS variable.

2023-02-13  Rimvydas Jasinskas  <rimvydas.jas@gmail.com>

	* decl.cc: Add EXT_ATTR_NOINLINE, EXT_ATTR_NORETURN, EXT_ATTR_WEAK.
	* gfortran.h (ext_attr_id_t): Ditto.
	* gfortran.texi (GCC$ ATTRIBUTES): Document them.
	* trans-decl.cc (build_function_decl): Apply them.

2023-02-09  Harald Anlauf  <anlauf@gmx.de>
	    Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/69636
	PR fortran/103779
	* intrinsic.cc (gfc_convert_chartype): Recover on invalid character
	kind in conversion instead of generating an internal error.

2023-02-09  Tobias Burnus  <tobias@codesourcery.com>

	PR fortran/107424
	* trans-openmp.cc (struct dovar_init_d): Add 'sym' and
	'non_unit_incr' members.
	(gfc_nonrect_loop_expr): New.
	(gfc_trans_omp_do): Call it; use normal loop bounds
	for unit stride - and only create local loop var.

2023-02-09  Tobias Burnus  <tobias@codesourcery.com>

	* parse.cc (decode_omp_directive): Really ignore 'assumes' with
	-fopenmp-simd.

2023-02-08  Steve Kargl  <kargl@gcc.gnu.org>

	PR fortran/103259
	* resolve.cc (resolve_common_vars): Avoid NULL pointer dereference
	when a symbol's location is not set.

2023-02-07  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/95107
	* trans-decl.cc (gfc_finish_var_decl): With -fno-automatic, do not
	make ASSOCIATE variables TREE_STATIC.

2023-02-05  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/108592
	* arith.cc (gfc_arith_divide): Emit integer division truncation
	warnings using gfc_warning instead of gfc_warning_now to prevent
	redundant messages.

2023-02-03  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/108451
	* trans-decl.cc (gfc_trans_use_stmts): Call clear_slot before
	doing continue.

2023-02-01  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/108609
	* expr.cc (find_array_section): Add check to prevent interpreting an
	mpz non-integer constant as an integer.

2023-02-01  Tobias Burnus  <tobias@codesourcery.com>

	* openmp.cc (resolve_omp_clauses): Check also for
	power of two.

2023-01-29  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/108450
	* check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
	(gfc_check_findloc): Ditto.

2023-01-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/103506
	* parse.cc (parse_module): Remove use of a bool error value
	that prevented proper setting of the namespace pointer.

2023-01-28  Harald Anlauf  <anlauf@gmx.de>
	    Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/108527
	* resolve.cc (compare_bound_int): Expression to compare must be of
	type INTEGER.
	(compare_bound_mpz_t): Likewise.
	(check_dimension): Fix comment on checks applied to array section
	and clean up associated logic.

2023-01-28  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/108453
	* match.cc (gfc_match_common): A USE associated name shall not appear
	in a COMMON block (F2018:C8121).

2023-01-27  Tobias Burnus  <tobias@codesourcery.com>

	PR fortran/108558
	* trans-openmp.cc (gfc_split_omp_clauses): Handle has_device_addr.

2023-01-26  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/108544
	* resolve.cc (check_host_association): Extend host association check
	so that it is not restricted to functions.  Also prevent NULL pointer
	dereference.

2023-01-25  Steve Kargl  <kargl@gcc.gnu.org>

	PR fortran/108528
	* array.cc (compare_bounds): Return false instead of generating an
	internal error on an invalid argument type.

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

	PR fortran/108529
	* simplify.cc (simplify_transformation): Do not try to simplify
	transformational intrinsic when the ARRAY argument has a NULL shape.

2023-01-23  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/108502
	* dependency.cc (gfc_check_dependency): Prevent NULL pointer
	dereference while recursively checking expressions.

2023-01-23  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/108501
	* interface.cc (get_expr_storage_size): Check array subscript triplets
	that we actually have integer values before trying to extract with
	mpz_get_si.

2023-01-23  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/108420
	* iresolve.cc (check_charlen_present): Preserve character length if
	there is no array constructor.

2023-01-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/102595
	* data.cc (gfc_assign_data_value): Remove check for PARAMETER in DATA.
	* primary.cc (match_variable): Add check for PARAMETER in DATA.

2023-01-19  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/108434
	* expr.cc (class_allocatable): Prevent NULL pointer dereference
	or invalid read.
	(class_pointer): Likewise.

2023-01-17  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/108421
	* interface.cc (get_expr_storage_size): Check that we actually have
	an integer value before trying to extract it with mpz_get_si.

2023-01-12  Tobias Burnus  <tobias@codesourcery.com>

	PR fortran/107706
	* openmp.cc (gfc_resolve_omp_assumptions): Reject nonscalars.

2023-01-11  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/108349
	* f95-lang.cc (gfc_init_builtin_function): Fix up function types
	for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}.  Formatting fixes.

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

	PR fortran/97345
	* frontend-passes.cc (do_subscript): Clear used gmp variables.

2023-01-02  Jakub Jelinek  <jakub@redhat.com>

	* gfortranspec.cc (lang_specific_driver): Update copyright notice
	dates.
	* gfc-internals.texi: Bump @copying's copyright year.
	* gfortran.texi: Ditto.
	* intrinsic.texi: Ditto.
	* invoke.texi: Ditto.


Copyright (C) 2023 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
