2024-07-19  Release Manager

	* GCC 11.5.0 released.

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

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

	PR fortran/114474
	* primary.c (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-05  Chung-Lin Tang  <cltang@codesourcery.com>

	Backported from master:
	2021-12-03  Tobias Burnus  <tobias@codesourcery.com>

	* trans-stmt.c (gfc_trans_allocate): Set e3_has_nodescriptor to true
	only for non-named arrays.

2024-04-02  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.c (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.c (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-03-29  Harald Anlauf  <anlauf@gmx.de>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	Backported from master:
	2022-12-18  Steve Kargl  <kargl@gcc.gnu.org>

	PR fortran/107397
	* decl.c (add_init_expr_to_sym): Add check with new error message.

2023-08-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	Backported from master:
	2023-01-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

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

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

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

	PR fortran/95947
	PR fortran/110658
	* trans-expr.c (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.c (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.c (gfc_compare_expr): Handle equality comparison of constant
	complex gfc_expr arguments.

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

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

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

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

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

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

2023-05-29  Release Manager

	* GCC 11.4.0 released.

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

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

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

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

	Backported from master:
	2023-02-03  Jakub Jelinek  <jakub@redhat.com>

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

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

	Backported from master:
	2023-01-11  Jakub Jelinek  <jakub@redhat.com>

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

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

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

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

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

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

2023-04-02  Andrew Pinski  <apinski@marvell.com>

	* dump-parse-tree.c (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-24  Harald Anlauf  <anlauf@gmx.de>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	Backported from master:
	2023-03-01  Tobias Burnus  <tobias@codesourcery.com>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	PR fortran/108527
	* resolve.c (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-02-04  Harald Anlauf  <anlauf@gmx.de>

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

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

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

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

	PR fortran/106209
	* decl.c (add_init_expr_to_sym): Handle bad initializers for
	implied-shape arrays.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	Backported from master:
	2022-12-23  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/108131
	* array.c (match_array_element_spec): Avoid too early simplification
	of matched array element specs that can lead to a misinterpretation
	when used as array bounds in array declarations.

2022-12-18  Paul Thomas  <pault@gcc.gnu.org>

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

	PR fortran/107872
	* resolve.c (derived_inaccessible): Skip over allocatable components
	to prevent an infinite loop.

2022-11-25  Harald Anlauf  <anlauf@gmx.de>

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

	PR fortran/107576
	* interface.c (gfc_procedure_use): Reject NULL as actual argument
	when there is no explicit procedure interface.

2022-10-29  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	Backported from master:
	2022-10-21  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	PR fortran/100097
	PR fortran/100098
	* trans-array.c (gfc_trans_class_array): New function to
	initialize class descriptor's TKR information.
	* trans-array.h (gfc_trans_class_array): Add function prototype.
	* trans-decl.c (gfc_trans_deferred_vars): Add calls to the new
	function for both pointers and allocatables.

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

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

	PR fortran/103413
	* symbol.c (gfc_type_compatible): A boz-literal-constant has no type
	and thus is not considered compatible to any type.

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

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

	PR fortran/105633
	* expr.c (find_array_section): Move check for NULL pointers so
	that both subscript triplets and vector subscripts are covered.

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

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

	PR fortran/106817
	* trans-expr.c (gfc_conv_procedure_call): Collect all clobbers
	to their own separate block.  Append the block of clobbers to
	the procedure preliminary block after the argument evaluation
	codes for all the arguments.

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

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

	PR fortran/105012
	* trans-expr.c (gfc_conv_procedure_call): Retrieve variable
	from the just calculated variable reference.

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

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

	* trans.h (gfc_conv_expr_reference): Remove add_clobber
	argument.
	* trans-expr.c (gfc_conv_expr_reference): Ditto. Inline code
	depending on add_clobber and conditions controlling it ...
	(gfc_conv_procedure_call): ... to here.

2022-10-08  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	Backported from master:
	2022-10-01  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	PR fortran/100040
	PR fortran/100029
	* trans-expr.c (gfc_conv_class_to_class): Add code to have
	assumed-rank arrays recognized as full arrays and fix the type
	of the array assignment.
	(gfc_conv_procedure_call): Change order of code blocks such that
	the free of ALLOCATABLE dummy arguments with INTENT(OUT) occurs
	first.

2022-10-01  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	Backported from master:
	2022-09-20  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	PR fortran/100132
	* trans-types.c (create_fn_spec): Fix function attributes when
	passing polymorphic pointers.

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

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

	PR fortran/107054
	* simplify.c (gfc_simplify_unpack): Replace assert by condition
	that terminates simplification when there are not enough elements
	in the constructor of argument VECTOR.

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

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

	PR fortran/82868
	* trans-decl.c (generate_coarray_sym_init): Skip symbol
	if attr.associate_var.

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

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

	PR fortran/106985
	* expr.c (gfc_simplify_expr): Avoid NULL pointer dereference.

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

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

	PR fortran/103694
	* simplify.c (simplify_size): The size expression of an array cannot
	be simplified if an error occurs while resolving the array spec.

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

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

	PR fortran/106986
	* simplify.c (gfc_simplify_findloc): Do not try to simplify
	intrinsic FINDLOC when the ARRAY argument has a NULL shape.

2022-09-24  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	Backported from master:
	2022-09-03  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	PR fortran/100245
	* trans-expr.c (trans_class_assignment): Add if clause to handle
	derived type in the LHS.

2022-09-22  Harald Anlauf  <anlauf@gmx.de>

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

	PR fortran/106857
	* simplify.c (gfc_simplify_pack): Check for NULL pointer dereferences
	while walking through constructors (error recovery).

2022-09-05  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	Backported from master:
	2022-09-04  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	PR fortran/100136
	* trans-expr.c (gfc_conv_procedure_call): Add handling of pointer
	expressions.

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

	Backported from master:
	2022-07-26  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/103504
	* interface.c (get_sym_storage_size): Array bounds and character
	length can only be of integer type.

2022-07-16  Steve Kargl  <kargl@gcc.gnu.org>

	Backported from master:
	2022-07-15  Steve Kargl  <kargl@gcc.gnu.org>

	PR fortran/104313
	* trans-decl.c (gfc_generate_return): Do not generate conflicting
	fake results for functions with no result variable under -ff2c.

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

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

	PR fortran/103137
	PR fortran/103138
	PR fortran/103693
	PR fortran/105243
	* decl.c (gfc_match_data_decl): Reject CLASS entity declaration
	when it is given the PARAMETER attribute.

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

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

	PR fortran/106121
	* simplify.c (gfc_simplify_extends_type_of): Do not attempt to
	simplify when one of the arguments is a CLASS variable that was
	not properly declared.

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

	Backported from master:
	2022-06-26  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/105954
	* decl.c (variable_decl): Adjust upper bounds for explicit-shape
	specs with constant bound expressions to ensure non-negative
	extents.

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

	Backported from master:
	2022-06-26  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/105691
	* simplify.c (gfc_simplify_index): Replace old simplification
	code by the equivalent of the runtime library implementation.  Use
	HOST_WIDE_INT instead of int for string index, length variables.

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

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

	PR fortran/105813
	* check.c (gfc_check_unpack): Try to simplify MASK argument to
	UNPACK so that checking of the VECTOR argument can work when MASK
	is a variable.

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

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

	PR fortran/105230
	* expr.c (find_array_section): Correct logic to avoid NULL
	pointer dereference on invalid array section.

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

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

	PR fortran/104849
	* expr.c (find_array_section): Avoid NULL pointer dereference on
	invalid array section.

2022-04-21  Fritz Reese  <foreese@gcc.gnu.org>

	Backported from master:
	2022-04-21  Fritz Reese  <foreese@gcc.gnu.org>

	PR fortran/105310
	* trans-expr.c (gfc_conv_union_initializer): Pass vec* by reference.

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>

