2022-04-21  Release Manager

	* GCC 11.3.0 released.

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

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

	PR fortran/105138
	* intrinsic.c (gfc_is_intrinsic): When a symbol refers to a
	RECURSIVE procedure, it cannot be an INTRINSIC.

2022-04-10  Mikael Morin  <mikael@gcc.gnu.org>

	Backported from master:
	2022-03-19  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/104228
	PR fortran/104570
	* parse.c (parse_associate): Use a new distinct gfc_charlen if the
	copied type has one whose length is not known to be constant.
	* resolve.c (resolve_assoc_var): Reset charlen if it’s shared with
	the associate target regardless of the expression type.
	Don’t reinitialize charlen if it’s deferred.

2022-04-10  Mikael Morin  <mikael@gcc.gnu.org>

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

	PR fortran/104228
	* resolve.c (resolve_assoc_var): Also create a new character
	length for non-dummy associate targets.
	* trans-stmt.c (trans_associate_var): Initialize character length
	even if no temporary is used for the associate variable.

2022-04-07  Harald Anlauf  <anlauf@gmx.de>

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

	PR fortran/104210
	* arith.c (eval_intrinsic): Avoid NULL pointer dereference.
	(gfc_zero_size_array): Likewise.

2022-03-19  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2022-03-07  Tobias Burnus  <tobias@codesourcery.com>

	PR fortran/99585
	PR fortran/104430
	* trans-expr.c (conv_parent_component_references): Fix comment;
	simplify comparison.
	(gfc_maybe_dereference_var): Avoid d referencing a nonpointer.

2022-03-17   Michael Meissner  <meissner@linux.ibm.com>

	PR fortran/96983
	* trans-intrinsic.c (build_round_expr): If int type is larger than
	long long, do the round and convert to the integer type.  Do not
	try to find a floating point type the exact size of the integer
	type.  Backport patch from 2021-04-22 on the trunk.

2022-03-13  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2022-03-08  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/104811
	* frontend-passes.c (optimize_minmaxloc): Do not attempt
	frontend-optimization of MINLOC/MAXLOC for character arrays, as
	there is no suitable code yet for inline expansion.

2022-02-23  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2022-02-22  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/104619
	* resolve.c (resolve_structure_cons): Skip shape check if shape
	of constructor cannot be determined at compile time.

2022-02-20  Harald Anlauf  <anlauf@gmx.de>

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

	PR fortran/66193
	* arith.c (reduce_binary_ac): When reducing binary expressions,
	try simplification.  Handle case of empty constructor.
	(reduce_binary_ca): Likewise.

2022-02-16  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2022-02-14  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/104211
	* expr.c (find_array_section): Replace assertion by error
	recovery when encountering bad array constructor.

2022-02-14  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/100337
	Backport from master.
	* trans-intrinsic.c (conv_co_collective): Check stat for null ptr
	before dereferrencing.

2022-02-14  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/103790
	Backported from master.
	* trans-array.c (structure_alloc_comps): Prevent descriptor
	stacking for non-array data; do not broadcast caf-tokens.
	* trans-intrinsic.c (conv_co_collective): Prevent generation
	of unused descriptor.

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

	Backported from master:
	2022-02-03  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/104311
	* check.c (gfc_calculate_transfer_sizes): Checks for case when
	storage size of SOURCE is greater than zero while the storage size
	of MOLD is zero and MOLD is an array shall not depend on SIZE.

2022-02-02  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2022-02-01  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/104331
	* simplify.c (gfc_simplify_eoshift): Avoid NULL pointer
	dereference when shape is not set.

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

	Backported from master:
	2022-01-22  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/104127
	* simplify.c (gfc_simplify_transfer): Ensure that the result
	typespec is set up for TRANSFER with MOLD of type CHARACTER
	including character length even if the result is a zero-sized
	array.

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

	Backported from master:
	2022-01-25  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/104212
	* check.c (gfc_check_norm2): Check that optional argument DIM is
	scalar.
	(gfc_check_parity): Likewise.

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

	Backported from master:
	2022-01-25  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/104227
	* check.c (gfc_calculate_transfer_sizes): Fix checking of arrays
	passed as MOLD argument to the TRANSFER intrinsic for having
	storage size zero.

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

	Backported from master:
	2022-01-15  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/83079
	* target-memory.c (gfc_interpret_character): Result length is
	in bytes and thus depends on the character kind.
	* trans-intrinsic.c (gfc_conv_intrinsic_transfer): Compute correct
	string length for the result of the TRANSFER intrinsic and for
	temporaries for the different character kinds.

2022-01-20  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2022-01-18  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103692
	* array.c (gfc_expand_constructor): Handle zero-sized array
	constructors.

2022-01-17  Mikael Morin  <mikael@gcc.gnu.org>

	Backported from master:
	2022-01-09  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/103789
	* trans-array.c (arg_evaluated_for_scalarization): Add MASKL, MASKR,
	SCAN and VERIFY to the list of intrinsics whose KIND argument is to be
	ignored.

2022-01-16  Mikael Morin  <mikael@gcc.gnu.org>

	Backported from master:
	2022-01-09  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/103789
	* trans-array.c (arg_evaluated_for_scalarization): Add MASKL, MASKR,
	SCAN and VERIFY to the list of intrinsics whose KIND argument is to be
	ignored.

2022-01-16  Mikael Morin  <mikael@gcc.gnu.org>

	Backported from master:
	2022-01-16  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/87711
	PR fortran/97896
	* trans-array.c (arg_evaluated_for_scalarization): Handle keyword and
	non-keyword arguments separatedly.  Adapt the expected argument index
	for KIND to each intrinsic in the non-keyword case.

2022-01-16  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2022-01-14  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103782
	* expr.c (gfc_simplify_expr): Adjust logic for when to scalarize a
	call of an intrinsic which may have been overloaded.

2022-01-16  Harald Anlauf  <anlauf@gmx.de>

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

	PR fortran/67804
	* primary.c (gfc_match_structure_constructor): Recover from errors
	that occurred while checking for a valid structure constructor in
	a DATA statement.

2022-01-15  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2022-01-09  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/101762
	* expr.c (gfc_check_pointer_assign): For pointer initialization
	targets, check that subscripts and substring indices in
	specifications are constant expressions.

2022-01-15  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2022-01-09  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103777
	* simplify.c (gfc_simplify_maskr): Check validity of argument 'I'
	before simplifying.
	(gfc_simplify_maskl): Likewise.

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

	Backported from master:
	2021-12-29  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/102332
	* expr.c (gfc_get_variable_expr): Avoid NULL pointer dereferences
	during handling of errors with invalid uses of CLASS variables.
	* match.c (select_type_set_tmp): Likewise.
	* primary.c (gfc_match_varspec): Likewise.
	* resolve.c (resolve_variable): Likewise.
	(resolve_select_type): Likewise.

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

	Backported from master:
	2021-12-22  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103776
	* match.c (match_case_selector): Reject expressions in CASE
	selector which are not scalar.

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

	Backported from master:
	2021-12-22  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103778
	* check.c (is_c_interoperable): A BOZ literal constant is not
	interoperable.

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

	Backported from master:
	2021-11-18  Harald Anlauf  <anlauf@gmx.de>
		    Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/101329
	* check.c (is_c_interoperable): Reject NULL() as it is not
	interoperable.

2021-12-19  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-12-10  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103418
	* check.c (variable_check): Replace previous check of procedure
	dummy arguments with INTENT(IN) attribute when passed to intrinsic
	procedures by gfc_check_vardef_context.
	* expr.c (gfc_check_vardef_context): Correct check of INTENT(IN)
	dummy arguments for the case of sub-components of a CLASS pointer.

2021-12-19  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-12-18  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103412
	* check.c (gfc_check_sizeof): Reject BOZ type argument.

2021-12-15  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-12-14  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103717
	* frontend-passes.c (doloop_code): Prevent NULL pointer
	dereference when checking for passing a do-loop variable to a
	contained procedure with an interface mismatch.

2021-12-15  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-12-14  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103718
	PR fortran/103719
	* frontend-passes.c (doloop_contained_procedure_code): Add several
	checks to prevent NULL pointer dereferences on valid and invalid
	code called within do-loops.

2021-12-12  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-12-11  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103606
	* resolve.c (resolve_fl_procedure): Do not access CLASS components
	before class container has been built.

2021-12-11  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-12-07  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103588
	* array.c (gfc_ref_dimen_size): Do not generate internal error on
	failed simplification of stride expression; just return failure.

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

	Backported from master:
	2021-12-08  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103610
	* array.c (spec_dimen_size): Fix simplification of SHAPE:
	dimensions must be non-negative.

2021-12-09  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-12-08  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103609
	* symbol.c (gfc_sym_get_dummy_args): Catch NULL pointer
	dereference.

2021-12-08  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-12-07  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103591
	* match.c (match_case_selector): Check type of upper bound in case
	range.

2021-12-08  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-12-07  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103607
	* frontend-passes.c (do_subscript): Ensure that array bounds are
	of type INTEGER before performing checks on array subscripts.

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

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

	PR fortran/102787
	* array.c (expand_constructor): When encountering a constant array
	expression or array section within a constructor, simplify it to
	enable better expansion.

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

	Backported from master:
	2021-10-14  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/102717
	* simplify.c (gfc_simplify_reshape): Replace assert by error
	message for negative elements in SHAPE array.

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

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

	PR fortran/103411
	* check.c (gfc_check_reshape): Improve check of size of source
	array for the RESHAPE intrinsic against the given shape when pad
	is not given, and shape is a parameter.  Try other simplifications
	of shape.

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

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

	PR fortran/103473
	* simplify.c (simplify_minmaxloc_nodim): Avoid NULL pointer
	dereference when shape is not set.

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

	Backported from master:
	2021-12-03  Harald Anlauf  <anlauf@gmx.de>
		    Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/103505
	* array.c (match_array_element_spec): Try to simplify array
	element specifications to improve early checking.
	* expr.c (gfc_try_simplify_expr): New.  Try simplification of an
	expression via gfc_simplify_expr.  When an error occurs, roll
	back.
	* gfortran.h (gfc_try_simplify_expr): Declare it.

2021-11-29  Jakub Jelinek  <jakub@redhat.com>

	Backported from master:
	2021-11-21  Jakub Jelinek  <jakub@redhat.com>

	PR debug/103315
	* trans-types.c (gfc_get_array_descr_info): Use DW_OP_deref_size 1
	instead of DW_OP_deref for DW_AT_rank.

2021-11-24  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-11-23  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103392
	* simplify.c (simplify_bound): Do not try to simplify
	LBOUND/UBOUND for arrays with POINTER or ALLOCATABLE attribute.

2021-11-24  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-11-23  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/87711
	PR fortran/87851
	* trans-array.c (arg_evaluated_for_scalarization): Add LEN_TRIM to
	list of intrinsics for which an optional KIND argument needs to be
	removed before scalarization.

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

	Backported from master:
	2021-11-21  Harald Anlauf  <anlauf@gmx.de>
		    Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/99061
	* trans-intrinsic.c (gfc_lookup_intrinsic): Helper function for
	looking up gfortran builtin intrinsics.
	(gfc_conv_intrinsic_atrigd): Use it.
	(gfc_conv_intrinsic_cotan): Likewise.
	(gfc_conv_intrinsic_cotand): Likewise.
	(gfc_conv_intrinsic_atan2d): Likewise.

2021-11-16  Mikael Morin  <mikael@gcc.gnu.org>

	Backported from master:
	2021-11-12  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/97896
	* intrinsic.c (add_sym_4ind): Remove.
	(add_functions): Use add_sym4 instead of add_sym4ind.
	Don’t special case the index intrinsic.
	* iresolve.c (gfc_resolve_index_func): Use the individual arguments
	directly instead of the full argument list.
	* intrinsic.h (gfc_resolve_index_func): Update the declaration
	accordingly.
	* trans-decl.c (gfc_get_extern_function_decl): Don’t modify the
	list of arguments in the case of the index intrinsic.
	* trans-array.h (gfc_get_intrinsic_for_expr,
	gfc_get_proc_ifc_for_expr): New.
	* trans-array.c (gfc_get_intrinsic_for_expr,
	arg_evaluated_for_scalarization): New.
	(gfc_walk_elemental_function_args): Add intrinsic procedure
	as argument.  Count arguments.  Check arg_evaluated_for_scalarization.
	* trans-intrinsic.c (gfc_walk_intrinsic_function): Update call.
	* trans-stmt.c (get_intrinsic_for_code): New.
	(gfc_trans_call): Update call.

2021-11-11  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-11-10  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103137
	PR fortran/103138
	* check.c (gfc_check_shape): Avoid NULL pointer dereference on
	missing ref.
	* simplify.c (gfc_simplify_cshift): Avoid NULL pointer dereference
	when shape not set.
	(gfc_simplify_transpose): Likewise.

2021-11-07  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-10-26  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/102816
	* resolve.c (resolve_structure_cons): Reject invalid array spec of
	a DT component referenced in a structure constructor.

2021-11-07  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-10-15  Harald Anlauf  <anlauf@gmx.de>
		    Tobias Burnus  <tobias@codesourcery.com>

	PR fortran/102685
	* decl.c (match_clist_expr): Set rank/shape of clist initializer
	to match LHS.
	* resolve.c (resolve_structure_cons): In a structure constructor,
	compare shapes of array components against declared shape.

2021-11-07  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-11-06  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/102715
	* decl.c (add_init_expr_to_sym): Reject rank mismatch between
	array and its initializer.

2021-11-07  Harald Anlauf  <anlauf@gmx.de>

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

	PR fortran/102817
	* expr.c (simplify_parameter_variable): Copy shape of referenced
	subobject when simplifying.

2021-11-07  Harald Anlauf  <anlauf@gmx.de>

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

	PR fortran/99348
	PR fortran/102521
	* decl.c (add_init_expr_to_sym): Extend initialization of
	parameter arrays from scalars to handle derived types.

2021-10-27  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-10-26  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/102917
	* decl.c (match_attr_spec): Remove invalid integer kind checks on
	KIND and LEN attributes of PDTs.

2021-10-19  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-10-18  Tobias Burnus  <tobias@codesourcery.com>

	PR fortran/102745
	* intrinsic.c (gfc_convert_type_warn): Fix checks by checking CLASS
	and do typcheck in correct order for type extension.
	* misc.c (gfc_typename): Print proper not internal CLASS type name.

2021-10-17  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-10-14  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/102716
	* check.c (gfc_check_shape): Reorder checks so that invalid KIND
	arguments can be detected.

2021-10-06  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-10-06  Tobias Burnus  <tobias@codesourcery.com>

	* resolve.c (resolve_values): Only show
	deprecated warning if attr.referenced.

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

	Backported from master:
	2021-09-30  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/102458
	* simplify.c (simplify_size): Resolve expressions used in array
	specifications so that SIZE can be simplified.

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

	Backported from master:
	2021-09-24  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/102458
	* expr.c (is_non_constant_intrinsic): Check for intrinsics
	excluded in constant expressions (F2018:10.1.12).
	(gfc_is_constant_expr): Use that check.

2021-09-30  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-09-29  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/102520
	* array.c (expand_constructor): Do not dereference NULL pointer.

2021-09-21  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-09-17  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/102366
	* trans-decl.c (gfc_finish_var_decl): Disable the warning message
	for variables moved from stack to static storange if they are
	declared in the main, but allow the move to happen.

2021-09-20  Tobias Burnus  <tobias@codesourcery.com>

	* trans-openmp.c (gfc_split_omp_clauses): Don't put 'order(concurrent)'
	on 'distribute' for combined directives, matching OpenMP 5.0

2021-09-19  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-09-16  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/102287
	* trans-expr.c (gfc_conv_procedure_call): Wrap deallocation of
	allocatable components of optional allocatable derived type
	procedure arguments with INTENT(OUT) into a presence check.

2021-09-19  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-09-14  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/102311
	* resolve.c (resolve_entries): Attempt to recover cleanly after
	rejecting mismatched function entries.

2021-09-16  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-09-13  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/85130
	* expr.c (find_substring_ref): Handle given substring start and
	end indices as signed integers, not unsigned.

2021-09-16  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-09-13  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/82314
	* decl.c (add_init_expr_to_sym): For proper initialization of
	array-valued named constants the array bounds need to be
	simplified before adding the initializer.

2021-09-11  Harald Anlauf  <anlauf@gmx.de>

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

	PR fortran/98490
	* trans-expr.c (gfc_conv_substring): Do not generate substring
	bounds check for implied do loop index variable before it actually
	becomes defined.

2021-09-11  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-09-07  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/101327
	* expr.c (find_array_element): When bounds cannot be determined as
	constant, return error instead of aborting.

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

	Backported from master:
	2021-08-31  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/100950
	* simplify.c (substring_has_constant_len): Minimize checks for
	substring expressions being allowed.

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

	Backported from master:
	2021-08-19  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/100950
	* simplify.c (substring_has_constant_len): New.
	(gfc_simplify_len): Handle case of substrings with constant
	bounds.

2021-09-03  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-08-30  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/101349
	* resolve.c (resolve_allocate_expr): An unlimited polymorphic
	argument to ALLOCATE must be ALLOCATABLE or a POINTER.  Fix the
	corresponding check.

2021-09-03  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-08-30  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/102113
	* match.c (gfc_match_goto): Allow for whitespace in parsing list
	of labels.

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

	Backported from master:
	2021-08-28  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/87737
	* resolve.c (resolve_entries): For functions of type CHARACTER
	tighten the checks for matching characteristics.

2021-08-28  Paul Thomas  <pault@gcc.gnu.org>

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

	PR fortran/46691
	PR fortran/99819
	* class.c (gfc_build_class_symbol): Remove the error that
	disables assumed size class arrays. Class array types that are
	not deferred shape or assumed rank are given a unique name and
	placed in the procedure namespace.
	* trans-array.c (gfc_trans_g77_array): Obtain the data pointer
	for class arrays.
	(gfc_trans_dummy_array_bias): Suppress the runtime error for
	extent violations in explicit shape class arrays because it
	always fails.
	* trans-expr.c (gfc_conv_procedure_call): Handle assumed size
	class actual arguments passed to non-descriptor formal args by
	using the data pointer, stored as the symbol's backend decl.

2021-08-26  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-08-24  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/98411
	* trans-decl.c (gfc_finish_var_decl): Adjust check to handle
	implicit SAVE as well as variables in the main program.  Improve
	warning message text.

2021-08-16  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-08-15  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/99351
	* match.c (sync_statement): Replace %v code by %e in gfc_match to
	allow for function references as STAT and ERRMSG arguments.
	* resolve.c (resolve_sync): Adjust checks of STAT= and ERRMSG= to
	being definable arguments.  Function references with a data
	pointer result are accepted.
	* trans-stmt.c (gfc_trans_sync): Adjust assertion.

2021-08-11  Harald Anlauf  <anlauf@gmx.de>

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

	PR fortran/101564
	* expr.c (gfc_check_vardef_context): Add check for KIND and LEN
	parameter inquiries.
	* match.c (gfc_match): Fix comment for %v code.
	(gfc_match_allocate, gfc_match_deallocate): Replace use of %v code
	by %e in gfc_match to allow for function references as STAT and
	ERRMSG arguments.
	* resolve.c (resolve_allocate_deallocate): Avoid NULL pointer
	dereferences and shortcut for bad STAT and ERRMSG argument to
	(DE)ALLOCATE.  Remove bogus parts of checks for STAT and ERRMSG.

2021-07-28  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-07-23  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/101536
	* check.c (array_check): Adjust check for the case of CLASS
	arrays.

2021-07-28  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-07-21  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/101514
	* target-memory.c (gfc_interpret_derived): Size of array component
	of derived type can only be computed here for explicit shape.
	* trans-types.c (gfc_get_nodesc_array_type): Do not dereference
	NULL pointers.

2021-07-28  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-07-18  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/101084
	* io.c (resolve_tag_format): Extend FORMAT check to unknown type.

2021-07-28  Release Manager

	* GCC 11.2.0 released.

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

	Backported from master:
	2021-07-14  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/100949
	* trans-expr.c (gfc_trans_class_init_assign): Call
	gfc_conv_expr_present only for dummy variables.

2021-07-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backported from master:
	2021-07-06  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/100227
	* frontend-passes.c (traverse_io_block): Adjust test for
	when a variable is eligible for the transformation to
	array slice.

2021-06-19  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-06-18  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/100283
	PR fortran/101123
	* trans-intrinsic.c (gfc_conv_intrinsic_minmax): Unconditionally
	convert result of min/max to result type.

2021-06-18  Harald Anlauf  <anlauf@gmx.de>

	Backported from master:
	2021-06-16  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/95501
	PR fortran/95502
	* expr.c (gfc_check_pointer_assign): Avoid NULL pointer
	dereference.
	* match.c (gfc_match_pointer_assignment): Likewise.
	* parse.c (gfc_check_do_variable): Avoid comparison with NULL
	symtree.

2021-06-17  Jakub Jelinek  <jakub@redhat.com>

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

	PR fortran/100965
	* trans-openmp.c (gfc_omp_finish_clause): Gimplify OMP_CLAUSE_SIZE.

2021-06-16  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	PR fortran/82376
	* trans-expr.c (gfc_conv_procedure_call): Evaluate function result
	and then pass a pointer.

2021-06-06  Andre Vehreschild  <vehre@gcc.gnu.org>
	    Steve Kargl  <kargl@gcc.gnu.org>

	PR fortran/98301
	* trans-decl.c (gfc_build_builtin_function_decls): Move decl.
	* trans-intrinsic.c (conv_intrinsic_random_init): Use bool for
	lib-call of caf_random_init instead of logical (4-byte).
	* trans.h: Add tree var for random_init.

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

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

	PR fortran/99839
	* frontend-passes.c (inline_matmul_assign): Do not inline matmul
	if the assignment to the resulting array if it is not of canonical
	type (real/integer/complex/logical).

2021-05-28  Harald Anlauf  <anlauf@gmx.de>

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

	PR fortran/98411
	* trans-decl.c (gfc_finish_var_decl): Add check for explicit SAVE
	attribute.

2021-05-28  Harald Anlauf  <anlauf@gmx.de>

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

	PR fortran/100656
	* trans-array.c (gfc_conv_ss_startstride): Do not call check for
	presence of a dummy argument when a symbol actually refers to a
	non-dummy.

2021-05-28  Harald Anlauf  <anlauf@gmx.de>

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

	PR fortran/100602
	* trans-intrinsic.c (gfc_conv_intrinsic_size): Use CLASS data
	attributes for CLASS arrays for generation of runtime error.

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

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

	PR fortran/100551
	* trans-expr.c (gfc_conv_procedure_call): Adjust check for
	implicit conversion of actual argument to an unlimited polymorphic
	procedure argument.

2021-05-25  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-25  Tobias Burnus  <tobias@codesourcery.com>
		    Johannes Nendwich  <a08727063@unet.univie.ac.at>

	* intrinsic.texi (GERROR, GETARGS, GETLOG, NORM2, PARITY, RANDOM_INIT,
	RANDOM_NUMBER): Fix typos and copy'n'paste errors.

2021-05-23  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-23  Tobias Burnus  <tobias@codesourcery.com>

	* intrinsic.texi (ATOMIC_ADD, ATOMIC_FETCH_ADD): Use the
	proper variable name in the description.

2021-05-18  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-17  Tobias Burnus  <tobias@codesourcery.com>

	PR fortran/100633
	* resolve.c (gfc_resolve_code): Reject nonintrinsic assignments in
	OMP WORKSHARE.

2021-05-17  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-14  Tobias Burnus  <tobias@codesourcery.com>

	* resolve.c (resolve_symbol): Handle implicit SAVE of main-program
	for vars in 'omp threadprivate' and 'omp declare target'.

