diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b6381eda8f863e96ed099ba8122f842c881f00e1..c68f4cd4d64af92cce6cabfd30ef39dc51a7794b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,97 @@
+2021-10-27  Saagar Jha  <saagar@saagarjha.com>
+
+	* config.gcc: Adjust for Darwin21.
+	* config/darwin-c.c (macosx_version_as_macro): Likewise.
+	* config/darwin-driver.c (validate_macosx_version_min):
+	Likewise.
+	(darwin_find_version_from_kernel): Likewise.
+
+2021-10-27  Aldy Hernandez  <aldyh@redhat.com>
+
+	* gimple-range-path.cc
+	(path_range_query::range_defined_in_block): Call killing_def.
+
+2021-10-27  Aldy Hernandez  <aldyh@redhat.com>
+
+	* gimple-range-fold.cc (fold_using_range::range_of_range_op): Dump
+	operands as well as relation.
+	* gimple-range-path.cc
+	(path_range_query::compute_ranges_in_block): Compute PHI relations
+	first.  Compute outgoing relations at the end.
+	(path_range_query::compute_ranges): Remove call to compute_relations.
+	(path_range_query::compute_relations): Remove.
+	(path_range_query::maybe_register_phi_relation): New.
+	(path_range_query::compute_phi_relations): Abstract out
+	registering one PHI relation to...
+	(path_range_query::compute_outgoing_relations): ...here.
+	* gimple-range-path.h (class path_range_query): Remove
+	compute_relations.
+	Add maybe_register_phi_relation.
+
+2021-10-27  Aldy Hernandez  <aldyh@redhat.com>
+	    Andrew MacLeod  <amacleod@redhat.com>
+
+	* value-relation.cc (path_oracle::killing_def): Kill second
+	order relations.
+
+2021-10-27  Martin Jambor  <mjambor@suse.cz>
+
+	* ipa-cp.c (good_cloning_opportunity_p): Decide whether to use
+	profile feedback depending on their local availability.
+
+2021-10-27  Martin Jambor  <mjambor@suse.cz>
+
+	* params.opt (param_ipa_cp_profile_count_base): New parameter.
+	* doc/invoke.texi (Optimize Options): Add entry for
+	ipa-cp-profile-count-base.
+	* ipa-cp.c (max_count): Replace with base_count, replace all
+	occurrences too, unless otherwise stated.
+	(ipcp_cloning_candidate_p): identify mostly-directly called
+	functions based on their counts, not max_count.
+	(compare_edge_profile_counts): New function.
+	(ipcp_propagate_stage): Instead of setting max_count, find the
+	appropriate edge count in a sorted vector of counts of eligible
+	edges and make it the base_count.
+
+2021-10-27  Martin Jambor  <mjambor@suse.cz>
+
+	* ipa-cp.c (struct caller_statistics): New fields rec_count_sum,
+	n_nonrec_calls and itself, document all fields.
+	(init_caller_stats): Initialize the above new fields.
+	(gather_caller_stats): Gather self-recursive counts and calls number.
+	(get_info_about_necessary_edges): Gather counts of self-recursive and
+	other edges bringing in the requested value separately.
+	(dump_profile_updates): Rework to dump info about a single node only.
+	(lenient_count_portion_handling): New function.
+	(struct gather_other_count_struct): New type.
+	(gather_count_of_non_rec_edges): New function.
+	(struct desc_incoming_count_struct): New type.
+	(analyze_clone_icoming_counts): New function.
+	(adjust_clone_incoming_counts): Likewise.
+	(update_counts_for_self_gen_clones): Likewise.
+	(update_profiling_info): Rewritten.
+	(update_specialized_profile): Adjust call to dump_profile_updates.
+	(create_specialized_node): Do not update profiling info.
+	(decide_about_value): New parameter self_gen_clones, either push new
+	clones into it or updat their profile counts.  For self-recursively
+	generated values, use a portion of the node count instead of count
+	from self-recursive edges to estimate goodness.
+	(decide_whether_version_node): Gather clones for self-generated values
+	in a new vector, update their profiles at once at the end.
+
+2021-10-27  Richard Biener  <rguenther@suse.de>
+
+	* tree-vectorizer.c (vect_transform_loops): New function,
+	split out from ...
+	(try_vectorize_loop_1): ... here.  Simplify as epilogues
+	are now fully handled in the split part.
+
+2021-10-27  Jakub Jelinek  <jakub@redhat.com>
+
+	* omp-expand.c (expand_omp_for_init_counts): Handle non-rectangular
+	iterators with pointer types.
+	(expand_omp_for_init_vars, extract_omp_for_update_vars): Likewise.
+
 2021-10-26  Martin Sebor  <msebor@redhat.com>
 
 	PR tree-optimization/102238
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 3b249e4ee3fd52c33ab2f9bb251a8fbb7f10ca76..0549f2720577f05087984ca12f8106cc3efd1725 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20211027
+20211028
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 9044f662c28f642d47a36533061ebf9f181f673d..18ba338c591b34dab7ff48b7d2e2c87030a91a22 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,21 @@
+2021-10-27  Jakub Jelinek  <jakub@redhat.com>
+
+	* c-omp.c (c_omp_check_loop_iv_r): Don't clear 3rd bit for
+	POINTER_PLUS_EXPR.
+	(c_omp_check_nonrect_loop_iv): Handle POINTER_PLUS_EXPR.
+	(c_omp_check_loop_iv): Set kind even if the iterator is non-integral.
+
+2021-10-27  Jakub Jelinek  <jakub@redhat.com>
+
+	PR c++/102854
+	* c-common.h (c_omp_check_loop_iv_exprs): Add enum tree_code argument.
+	* c-omp.c (c_omp_check_loop_iv_r): For trees other than decls,
+	TREE_VEC, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, POINTER_PLUS_EXPR or
+	conversions temporarily clear the 3rd bit from d->kind while walking
+	subtrees.
+	(c_omp_check_loop_iv_exprs): Add CODE argument.  Or in 4 into data.kind
+	if possibly non-rectangular.
+
 2021-10-21  Jakub Jelinek  <jakub@redhat.com>
 
 	PR middle-end/64888
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ced68643d63cd712f96984883d7e862e34cd5dd1..9bb19f22406afa6e7718f1bacebfe3fc76b0ebba 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,34 @@
+2021-10-27  Jakub Jelinek  <jakub@redhat.com>
+
+	PR c++/102854
+	* semantics.c (handle_omp_for_class_iterator,
+	finish_omp_for): Adjust c_omp_check_loop_iv_exprs caller.
+
+2021-10-27  Jakub Jelinek  <jakub@redhat.com>
+
+	PR c++/102753
+	* constexpr.c (cxx_eval_outermost_constant_expr): Perform
+	find_immediate_fndecl discovery if is_consteval or
+	in_immediate_context () rather than if is_consteval, t != r
+	and not in immediate function's body.
+
+2021-10-27  Jakub Jelinek  <jakub@redhat.com>
+
+	PR c++/102753
+	* cp-tree.h (saved_scope): Document that consteval_if_p member
+	is also set while processing immediate invocation.
+	(in_immediate_context): Declare.
+	* call.c (in_immediate_context): New function.
+	(immediate_invocation_p): Use it.
+	(struct in_consteval_if_p_temp_override): New class.
+	(build_over_call): Temporarily set in_consteval_if_p for processing
+	immediate invocation arguments.
+	* typeck.c (cp_build_addr_expr_1): Diagnose taking address of
+	an immediate method.  Use t instead of TREE_OPERAND (arg, 1).
+	Use in_immediate_context function.
+	* constexpr.c (find_immediate_fndecl): Handle PTRMEM_CST
+	which refers to immediate function decl.
+
 2021-10-26  Marek Polacek  <polacek@redhat.com>
 
 	PR c++/102617
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 6d0a022b36312e9662608132dea4a632e29c7762..70a4aa56c5ffa96402b81fea9336fc85e519ac20 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,70 @@
+2021-10-27  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>
+
+	* intrinsic.h (gfc_check_sum, gfc_resolve_atan2d, gfc_resolve_kill,
+	gfc_resolve_kill_sub): Delete declaration.
+
+2021-10-27  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>
+
+	* trans-types.h (gfc_convert_function_code): Delete.
+
+2021-10-27  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>
+
+	* trans-stmt.h (gfc_trans_deallocate_array): Delete.
+
+2021-10-27  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>
+
+	* trans-array.c (gfc_trans_scalarized_loop_end): Make static.
+	* trans-array.h (gfc_trans_scalarized_loop_end,
+	gfc_conv_tmp_ref, gfc_conv_array_transpose): Delete declaration.
+
+2021-10-27  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>
+
+	* constructor.c (gfc_constructor_get_base): Make static.
+	(gfc_constructor_expr_foreach, gfc_constructor_swap): Delete.
+	* constructor.h (gfc_constructor_get_base): Remove declaration.
+	(gfc_constructor_expr_foreach, gfc_constructor_swap): Delete.
+
+2021-10-27  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>
+
+	* decl.c (gfc_match_old_kind_spec, set_com_block_bind_c,
+	set_verify_bind_c_sym, set_verify_bind_c_com_block,
+	get_bind_c_idents, gfc_match_suffix, gfc_get_type_attr_spec,
+	check_extended_derived_type): Make static.
+	(gfc_match_gcc_unroll): Add comment.
+	* match.c (gfc_match_small_int_expr): Delete definition.
+	* match.h (gfc_match_small_int_expr): Delete declaration.
+	(gfc_match_name_C, gfc_match_old_kind_spec, set_com_block_bind_c,
+	set_verify_bind_c_sym, set_verify_bind_c_com_block,
+	get_bind_c_idents, gfc_match_suffix,
+	gfc_get_type_attr_spec): Delete declaration.
+
+2021-10-27  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>
+
+	* expr.c (is_non_empty_structure_constructor): Make static.
+	* gfortran.h (gfc_check_any_c_kind): Delete.
+	* match.c (gfc_match_label): Make static.
+	* match.h (gfc_match_label): Delete declaration.
+	* scanner.c (file_changes_cur, file_changes_count,
+	file_changes_allocated): Make static.
+	* trans-expr.c (gfc_get_character_len): Make static.
+	(gfc_class_len_or_zero_get): Make static.
+	(VTAB_GET_FIELD_GEN): Undefine.
+	(gfc_get_class_array_ref): Make static.
+	(gfc_finish_interface_mapping): Make static.
+	* trans-types.c (gfc_check_any_c_kind): Delete.
+	(pfunc_type_node, dtype_type_node, gfc_get_ppc_type): Make static.
+	* trans-types.h (gfc_get_ppc_type): Delete declaration.
+	* trans.c (gfc_msg_wrong_return): Delete.
+	* trans.h (gfc_class_len_or_zero_get, gfc_class_vtab_extends_get,
+	gfc_vptr_extends_get, gfc_get_class_array_ref, gfc_get_character_len,
+	gfc_finish_interface_mapping, gfc_msg_wrong_return,
+	gfc_get_function_decl): Delete declaration.
+
+2021-10-27  Tobias Burnus  <tobias@codesourcery.com>
+
+	* trans-stmt.c (gfc_trans_select_rank_cases): Fix condition
+	for allocatables/pointers.
+
 2021-10-26  Harald Anlauf  <anlauf@gmx.de>
 
 	PR fortran/102956
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d16e500819aabf5e5c893d7243e9e55b7ae06579..b69666d2fa0b1d882778e06184f639d88e55a5cb 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,44 @@
+2021-10-27  Martin Sebor  <msebor@redhat.com>
+
+	* gcc.dg/Warray-bounds-90.c: Fix a typo.
+
+2021-10-27  Tobias Burnus  <tobias@codesourcery.com>
+
+	* gfortran.dg/PR93963.f90: Extend testcase by scan-tree-dump test.
+
+2021-10-27  Jakub Jelinek  <jakub@redhat.com>
+
+	PR tree-optimization/102897
+	* gcc.dg/pr102897.c: Add -Wno-psabi to dg-options.
+
+2021-10-27  Jakub Jelinek  <jakub@redhat.com>
+
+	* c-c++-common/gomp/loop-8.c: New test.
+	* c-c++-common/gomp/loop-9.c: New test.
+
+2021-10-27  Jakub Jelinek  <jakub@redhat.com>
+
+	PR c++/102854
+	* g++.dg/gomp/loop-3.C: Don't expect some errors.
+	* g++.dg/gomp/loop-7.C: New test.
+
+2021-10-27  Jakub Jelinek  <jakub@redhat.com>
+
+	PR c++/102753
+	* g++.dg/cpp2a/consteval7.C: Expect diagnostics on quux.
+	* g++.dg/cpp2a/consteval24.C: New test.
+	* g++.dg/cpp23/consteval-if12.C: New test.
+
+2021-10-27  Jakub Jelinek  <jakub@redhat.com>
+
+	PR c++/102753
+	* g++.dg/cpp2a/consteval13.C: Don't expect errors.
+	* g++.dg/cpp2a/consteval20.C: New test.
+	* g++.dg/cpp2a/consteval21.C: New test.
+	* g++.dg/cpp2a/consteval22.C: New test.
+	* g++.dg/cpp2a/consteval23.C: New test.
+	* g++.dg/cpp23/consteval-if11.C: New test.
+
 2021-10-26  Martin Sebor  <msebor@redhat.com>
 
 	PR tree-optimization/102238
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 9285bd643b25fd6ec2bf7e60275359394952c0d2..4550672684e208a11cc13557eaf01dea2a1ea99b 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,7 @@
+2021-10-27  H.J. Lu  <hjl.tools@gmail.com>
+
+	* LOCAL_PATCHES: Add commit 90454a90082.
+
 2021-10-25  Segher Boessenkool  <segher@kernel.crashing.org>
 
 	* src/powerpc/linux64.S: Enable AltiVec insns.
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 19ce60757ec5929b865f9651980381b91a941db8..37774451f68cff13388552b15a9bb7d91c3f4d2f 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,14 @@
+2021-10-27  John David Anglin  <danglin@gcc.gnu.org>
+
+	* config.host (hppa*64*-*-linux*): Don't add pa/t-linux to
+	tmake_file.
+	* config/pa/linux-atomic.c: Define u8, u16 and u64 types.
+	Use them in FETCH_AND_OP_2, OP_AND_FETCH_2, COMPARE_AND_SWAP_2,
+	SYNC_LOCK_TEST_AND_SET_2 and SYNC_LOCK_RELEASE_1 macros.
+	* config/pa/t-linux64 (LIB1ASMSRC): New define.
+	(LIB1ASMFUNCS): Revise.
+	(HOST_LIBGCC2_CFLAGS): Add "-DLINUX=1".
+
 2021-10-22  Stafford Horne  <shorne@gmail.com>
 
 	* config/or1k/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING):
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 3ff917ce80fc4ad27f986e85553b26524cdb00eb..123d2536cbefd1ce535dce3c2da5da7f4f7aab50 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,13 @@
+2021-10-27  Jakub Jelinek  <jakub@redhat.com>
+
+	* libgomp.texi (OpenMP 5.0): Mention that Non-rectangular loop nests
+	aren't implemented for Fortran yet.
+
+2021-10-27  Jakub Jelinek  <jakub@redhat.com>
+
+	* testsuite/libgomp.c/loop-26.c: New test.
+	* testsuite/libgomp.c/loop-27.c: New test.
+
 2021-10-25  Tobias Burnus  <tobias@codesourcery.com>
 
 	PR testsuite/102910