Merge from trunk revision f49e3d28be44179f07b8a06159139ce77096dda7.
diff --git a/ChangeLog b/ChangeLog
index 913f9a6..c0fb0f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-10-07  Siddhesh Poyarekar  <siddhesh@gotplt.org>
+
+	* MAINTAINERS: Add myself to DCO section and update email
+	address.
+
 2021-09-29  Jonathan Wakely  <jwakely@redhat.com>
 
 	* MAINTAINERS: Add myself to DCO section.
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f9b93b2..425ec28 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,127 @@
+2021-10-07  Indu Bhagat  <indu.bhagat@oracle.com>
+
+	* ctfc.c (ctfc_delete_container): Free hash table contents.
+
+2021-10-07  Indu Bhagat  <indu.bhagat@oracle.com>
+
+	* toplev.c (process_options): Do not warn for GNU GIMPLE.
+
+2021-10-07  Siddhesh Poyarekar  <siddhesh@gotplt.org>
+
+	* tree-object-size.c (addr_object_size,
+	compute_builtin_object_size): Drop PDECL and POFF arguments.
+	(addr_object_size): Adjust calls.
+	* tree-object-size.h (compute_builtin_object_size): Drop PDECL
+	and POFF arguments.
+
+2021-10-07  Roger Sayle  <roger@nextmovesoftware.com>
+
+	* rtl.def (SMUL_HIGHPART, UMUL_HIGHPART): New RTX codes for
+	representing signed and unsigned high-part multiplication resp.
+	* simplify-rtx.c (simplify_binary_operation_1) [SMUL_HIGHPART,
+	UMUL_HIGHPART]: Simplify high-part multiplications by zero.
+	[SS_PLUS, US_PLUS, SS_MINUS, US_MINUS, SS_MULT, US_MULT,
+	SS_DIV, US_DIV]: Similar simplifications for saturating
+	arithmetic.
+	(simplify_const_binary_operation) [SS_PLUS, US_PLUS, SS_MINUS,
+	US_MINUS, SS_MULT, US_MULT, SMUL_HIGHPART, UMUL_HIGHPART]:
+	Implement compile-time evaluation for constant operands.
+	* dwarf2out.c (mem_loc_descriptor): Skip SMUL_HIGHPART and
+	UMUL_HIGHPART.
+	* doc/rtl.texi (smul_highpart, umul_highpart): Document RTX codes.
+	* doc/md.texi (smul@var{m}3_highpart, umul@var{m3}_highpart):
+	Mention the new smul_highpart and umul_highpart RTX codes.
+	* doc/invoke.texi: Silence @xref "compilation" warnings.
+
+2021-10-07  Martin Jambor  <mjambor@suse.cz>
+
+	PR ipa/102388
+	* ipa-prop.c (ipa_edge_args_sum_t::duplicate): Also handle the
+	case when the source reference description corresponds to a
+	referance taken in a function src->caller is inlined to.
+
+2021-10-07  Jan Hubicka  <hubicka@ucw.cz>
+
+	PR ipa/102581
+	* ipa-modref-tree.h (modref_access_node::contains_p): Handle offsets
+	better.
+	(modref_access_node::try_merge_with): Add sanity check that there
+	are no redundant entries in the list.
+
+2021-10-07  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/102608
+	* tree-ssa-sccvn.c (visit_stmt): Drop .DEFERRED_INIT to
+	varying.
+
+2021-10-07  Martin Liska  <mliska@suse.cz>
+
+	* toplev.c (toplev::main): Make
+	save_opt_decoded_options a pointer type
+	* toplev.h: Likewise.
+
+2021-10-07  Andrew Stubbs  <ams@codesourcery.com>
+
+	* config/gcn/gcn-valu.md (gather<mode>_insn_2offsets<exec>): Apply
+	HAVE_GCN_ASM_GLOBAL_LOAD_FIXED.
+	(scatter<mode>_insn_2offsets<exec_scatter>): Likewise.
+
+2021-10-07  Andrew Stubbs  <ams@codesourcery.com>
+
+	* config/gcn/gcn-hsa.h (SRAMOPT): Include the whole option string.
+	Adjust for new -msram-ecc=any behaviour.
+	(ASM_SPEC): Adjust -mxnack and -msram-ecc usage.
+	* config/gcn/gcn.c (output_file_start): Implement -msram-ecc=any.
+	* config/gcn/mkoffload.c (EF_AMDGPU_XNACK): Rename to ...
+	(EF_AMDGPU_XNACK_V3): ... this.
+	(EF_AMDGPU_SRAM_ECC): Rename to ...
+	(EF_AMDGPU_SRAM_ECC_V3): ... this.
+	(EF_AMDGPU_FEATURE_XNACK_V4): New.
+	(EF_AMDGPU_FEATURE_XNACK_UNSUPPORTED_V4): New.
+	(EF_AMDGPU_FEATURE_XNACK_ANY_V4): New.
+	(EF_AMDGPU_FEATURE_XNACK_OFF_V4): New.
+	(EF_AMDGPU_FEATURE_XNACK_ON_V4): New.
+	(EF_AMDGPU_FEATURE_SRAMECC_V4): New.
+	(EF_AMDGPU_FEATURE_SRAMECC_UNSUPPORTED_V4): New.
+	(EF_AMDGPU_FEATURE_SRAMECC_ANY_V4): New.
+	(EF_AMDGPU_FEATURE_SRAMECC_OFF_V4): New.
+	(EF_AMDGPU_FEATURE_SRAMECC_ON_V4): New.
+	(SET_XNACK_ON): New.
+	(SET_XNACK_OFF): New.
+	(TEST_XNACK): New.
+	(SET_SRAM_ECC_ON): New.
+	(SET_SRAM_ECC_ANY): New.
+	(SET_SRAM_ECC_OFF): New.
+	(TEST_SRAM_ECC_ANY): New.
+	(TEST_SRAM_ECC_ON): New.
+	(main): Implement HSACOv4 and -msram-ecc=any.
+
+2021-10-07  Andrew Stubbs  <ams@codesourcery.com>
+
+	* config.in: Regenerate.
+	* config/gcn/gcn-hsa.h (X_FIJI): New macro.
+	(X_900): New macro.
+	(X_906): New macro.
+	(X_908): New macro.
+	(A_FIJI): Rename to ...
+	(S_FIJI): ... this.
+	(A_900): Rename to ...
+	(S_900): ... this.
+	(A_906): Rename to ...
+	(S_906): ... this.
+	(A_908): Rename to ...
+	(S_908): ... this.
+	(SRAMOPT): New macro.
+	(ASM_SPEC): Adjust xnack option usage.
+	* config/gcn/gcn.c (output_file_start): Adjust amdgcn_target usage.
+	* configure: Regenerate.
+	* configure.ac: Detect LLVM assembler dialect.
+
+2021-10-07  Richard Biener  <rguenther@suse.de>
+
+	* tree-pretty-print.c (dump_generic_node): Do not elide
+	printing '&' when dumping with -gimple.
+
 2021-10-06  Andrew MacLeod  <amacleod@redhat.com>
 
 	* gimple-range-cache.cc (non_null_ref::adjust_range): Call new
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index e528add..202e0fe 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20211007
+20211008
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index a6484f4..c3ee247 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,8 @@
+2021-10-07  Martin Liska  <mliska@suse.cz>
+
+	* c-common.c (parse_optimize_options): Make
+	save_opt_decoded_options a pointer type.
+
 2021-10-06  Jakub Jelinek  <jakub@redhat.com>
 
 	PR tree-optimization/102571
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 24096bb..c5f5575 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,7 @@
+2021-10-07  Richard Biener  <rguenther@suse.de>
+
+	* c-typeck.c (lvalue_p): Also allow MEM_REF and TARGET_MEM_REF.
+
 2021-10-05  Richard Biener  <rguenther@suse.de>
 
 	PR c/102605
diff --git a/gcc/common.opt b/gcc/common.opt
index a9644ca..52693e2 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -3034,7 +3034,7 @@
 
 ; Alias to enable both -ftree-loop-vectorize and -ftree-slp-vectorize.
 ftree-vectorize
-Common Optimization
+Common Var(flag_tree_vectorize) Optimization
 Enable vectorization on trees.
 
 ftree-vectorizer-verbose=
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index 4780b99..3e6f7d8e 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -16043,6 +16043,11 @@
     case E_V2DFmode:
       tem = gen_vec_interleave_highv2df (dest, src, src);
       break;
+    case E_V4HImode:
+      d = gen_reg_rtx (V1DImode);
+      tem = gen_mmx_lshrv1di3 (d, gen_lowpart (V1DImode, src),
+			       GEN_INT (i / 2));
+      break;
     case E_V16QImode:
     case E_V8HImode:
     case E_V8HFmode:
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index a566d84..7bc1b05 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -23582,20 +23582,24 @@
       return opt_type == OPTIMIZE_FOR_SPEED;
 
     case rint_optab:
-      if (SSE_FLOAT_MODE_P (mode1)
-	  && TARGET_SSE_MATH
-	  && !flag_trapping_math
-	  && !TARGET_SSE4_1)
+      if (mode1 == HFmode)
+	return true;
+      else if (SSE_FLOAT_MODE_P (mode1)
+	       && TARGET_SSE_MATH
+	       && !flag_trapping_math
+	       && !TARGET_SSE4_1)
 	return opt_type == OPTIMIZE_FOR_SPEED;
       return true;
 
     case floor_optab:
     case ceil_optab:
     case btrunc_optab:
-      if (SSE_FLOAT_MODE_P (mode1)
-	  && TARGET_SSE_MATH
-	  && !flag_trapping_math
-	  && TARGET_SSE4_1)
+      if (mode1 == HFmode)
+	return true;
+      else if (SSE_FLOAT_MODE_P (mode1)
+	       && TARGET_SSE_MATH
+	       && !flag_trapping_math
+	       && TARGET_SSE4_1)
 	return true;
       return opt_type == OPTIMIZE_FOR_SPEED;
 
diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md
index c9467bc..106d41c 100644
--- a/gcc/config/i386/mmx.md
+++ b/gcc/config/i386/mmx.md
@@ -3965,6 +3965,42 @@
   DONE;
 })
 
+(define_expand "reduc_plus_scal_v4hi"
+ [(plus:V4HI
+    (match_operand:HI 0 "register_operand")
+    (match_operand:V4HI 1 "register_operand"))]
+ "TARGET_MMX_WITH_SSE"
+{
+  rtx tmp = gen_reg_rtx (V4HImode);
+  ix86_expand_reduc (gen_addv4hi3, tmp, operands[1]);
+  emit_insn (gen_vec_extractv4hihi (operands[0], tmp, const0_rtx));
+  DONE;
+})
+
+(define_expand "reduc_<code>_scal_v4hi"
+  [(smaxmin:V4HI
+     (match_operand:HI 0 "register_operand")
+     (match_operand:V4HI 1 "register_operand"))]
+  "TARGET_MMX_WITH_SSE"
+{
+  rtx tmp = gen_reg_rtx (V4HImode);
+  ix86_expand_reduc (gen_<code>v4hi3, tmp, operands[1]);
+  emit_insn (gen_vec_extractv4hihi (operands[0], tmp, const0_rtx));
+  DONE;
+})
+
+(define_expand "reduc_<code>_scal_v4hi"
+  [(umaxmin:V4HI
+     (match_operand:HI 0 "register_operand")
+     (match_operand:V4HI 1 "register_operand"))]
+  "TARGET_MMX_WITH_SSE && TARGET_SSE4_1"
+{
+  rtx tmp = gen_reg_rtx (V4HImode);
+  ix86_expand_reduc (gen_<code>v4hi3, tmp, operands[1]);
+  emit_insn (gen_vec_extractv4hihi (operands[0], tmp, const0_rtx));
+  DONE;
+})
+
 (define_expand "usadv8qi"
   [(match_operand:V2SI 0 "register_operand")
    (match_operand:V8QI 1 "register_operand")
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 97d0a35..b4acf62 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,21 @@
+2021-10-07  Patrick Palka  <ppalka@redhat.com>
+
+	PR c++/61355
+	* pt.c (convert_template_argument): Perform array/function to
+	pointer conversion on the substituted type of an NTTP.
+
+2021-10-07  Patrick Palka  <ppalka@redhat.com>
+
+	PR c++/99904
+	* pt.c (is_compatible_template_arg): Set processing_template_decl
+	around tsubst_constraint_info.
+
+2021-10-07  Jonathan Wakely  <jwakely@redhat.com>
+
+	PR c++/102482
+	* init.c (maybe_warn_list_ctor): Do not warn for a reference to
+	a non-const std::initializer_list.
+
 2021-10-06  Jakub Jelinek  <jakub@redhat.com>
 
 	PR c++/102612
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 0500773..8b3ebcf 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10453,9 +10453,12 @@
 -fstrict-aliasing @gol
 -fthread-jumps @gol
 -ftree-builtin-call-dce @gol
+-ftree-loop-vectorize @gol
 -ftree-pre @gol
+-ftree-slp-vectorize @gol
 -ftree-switch-conversion  -ftree-tail-merge @gol
--ftree-vrp}
+-ftree-vrp @gol
+-fvect-cost-model=very-cheap}
 
 Please note the warning under @option{-fgcse} about
 invoking @option{-O2} on programs that use computed gotos.
@@ -10475,11 +10478,8 @@
 -fsplit-loops @gol
 -fsplit-paths @gol
 -ftree-loop-distribution @gol
--ftree-loop-vectorize @gol
 -ftree-partial-pre @gol
--ftree-slp-vectorize @gol
 -funswitch-loops @gol
--fvect-cost-model @gol
 -fvect-cost-model=dynamic @gol
 -fversion-loops-for-strides}
 
diff --git a/gcc/match.pd b/gcc/match.pd
index a9791ce..9d7c1ac 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -6191,6 +6191,35 @@
    (froms (convert float_value_p@0))
    (convert (tos @0)))))
 
+#if GIMPLE
+(match float16_value_p
+ @0
+ (if (TYPE_MAIN_VARIANT (TREE_TYPE (@0)) == float16_type_node)))
+(for froms (BUILT_IN_TRUNCL BUILT_IN_TRUNC BUILT_IN_TRUNCF
+	    BUILT_IN_FLOORL BUILT_IN_FLOOR BUILT_IN_FLOORF
+	    BUILT_IN_CEILL BUILT_IN_CEIL BUILT_IN_CEILF
+	    BUILT_IN_ROUNDEVENL BUILT_IN_ROUNDEVEN BUILT_IN_ROUNDEVENF
+	    BUILT_IN_ROUNDL BUILT_IN_ROUND BUILT_IN_ROUNDF
+	    BUILT_IN_NEARBYINTL BUILT_IN_NEARBYINT BUILT_IN_NEARBYINTF
+	    BUILT_IN_RINTL BUILT_IN_RINT BUILT_IN_RINTF)
+     tos (IFN_TRUNC IFN_TRUNC IFN_TRUNC
+	  IFN_FLOOR IFN_FLOOR IFN_FLOOR
+	  IFN_CEIL IFN_CEIL IFN_CEIL
+	  IFN_ROUNDEVEN IFN_ROUNDEVEN IFN_ROUNDEVEN
+	  IFN_ROUND IFN_ROUND IFN_ROUND
+	  IFN_NEARBYINT IFN_NEARBYINT IFN_NEARBYINT
+	  IFN_RINT IFN_RINT IFN_RINT)
+ /* (_Float16) round ((doube) x) -> __built_in_roundf16 (x), etc.,
+    if x is a _Float16.  */
+ (simplify
+   (convert (froms (convert float16_value_p@0)))
+     (if (optimize
+	  && types_match (type, TREE_TYPE (@0))
+	  && direct_internal_fn_supported_p (as_internal_fn (tos),
+					     type, OPTIMIZE_FOR_BOTH))
+       (tos @0))))
+#endif
+
 (for froms (XFLOORL XCEILL XROUNDL XRINTL)
      tos (XFLOOR XCEIL XROUND XRINT)
  /* llfloorl(extend(x)) -> llfloor(x), etc., if x is a double.  */
diff --git a/gcc/opts.c b/gcc/opts.c
index 6503980..2116c29 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -634,7 +634,8 @@
     { OPT_LEVELS_2_PLUS, OPT_ftree_switch_conversion, NULL, 1 },
     { OPT_LEVELS_2_PLUS, OPT_ftree_tail_merge, NULL, 1 },
     { OPT_LEVELS_2_PLUS, OPT_ftree_vrp, NULL, 1 },
-    { OPT_LEVELS_2_PLUS, OPT_fvect_cost_model_, NULL, VECT_COST_MODEL_CHEAP },
+    { OPT_LEVELS_2_PLUS, OPT_fvect_cost_model_, NULL,
+      VECT_COST_MODEL_VERY_CHEAP },
     { OPT_LEVELS_2_PLUS, OPT_finline_functions, NULL, 1 },
     { OPT_LEVELS_2_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
 
@@ -646,6 +647,8 @@
     { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_foptimize_strlen, NULL, 1 },
     { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_freorder_blocks_algorithm_, NULL,
       REORDER_BLOCKS_ALGORITHM_STC },
+    { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_ftree_loop_vectorize, NULL, 1 },
+    { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_ftree_slp_vectorize, NULL, 1 },
 #ifdef INSN_SCHEDULING
   /* Only run the pre-regalloc scheduling pass if optimizing for speed.  */
     { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_fschedule_insns, NULL, 1 },
@@ -663,9 +666,7 @@
     { OPT_LEVELS_3_PLUS, OPT_fsplit_loops, NULL, 1 },
     { OPT_LEVELS_3_PLUS, OPT_fsplit_paths, NULL, 1 },
     { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribution, NULL, 1 },
-    { OPT_LEVELS_3_PLUS, OPT_ftree_loop_vectorize, NULL, 1 },
     { OPT_LEVELS_3_PLUS, OPT_ftree_partial_pre, NULL, 1 },
-    { OPT_LEVELS_3_PLUS, OPT_ftree_slp_vectorize, NULL, 1 },
     { OPT_LEVELS_3_PLUS, OPT_funswitch_loops, NULL, 1 },
     { OPT_LEVELS_3_PLUS, OPT_fvect_cost_model_, NULL, VECT_COST_MODEL_DYNAMIC },
     { OPT_LEVELS_3_PLUS, OPT_fversion_loops_for_strides, NULL, 1 },
@@ -1343,6 +1344,15 @@
     opts->x_flag_complex_method = 1;
   else if (opts_set->x_flag_cx_fortran_rules)
     opts->x_flag_complex_method = opts->x_flag_default_complex_method;
+
+  /* Use -fvect-cost-model=cheap instead of -fvect-cost-mode=very-cheap
+     by default with explicit -ftree-{loop,slp}-vectorize.  */
+  if (opts->x_optimize == 2
+      && (opts_set->x_flag_tree_loop_vectorize
+	  || opts_set->x_flag_tree_vectorize))
+    SET_OPTION_IF_UNSET (opts, opts_set, flag_vect_cost_model,
+			 VECT_COST_MODEL_CHEAP);
+
 }
 
 #define LEFT_COLUMN	27
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a3159bd..1cc6add 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,39 @@
+2021-10-07  Patrick Palka  <ppalka@redhat.com>
+
+	PR c++/61355
+	* g++.old-deja/g++.pt/nontype5.C: Adjust.
+	* g++.dg/template/param6.C: New test.
+
+2021-10-07  Roger Sayle  <roger@nextmovesoftware.com>
+
+	* gcc.target/i386/sse2-mmx-paddsb-2.c: New test case.
+	* gcc.target/i386/sse2-mmx-paddusb-2.c: New test case.
+	* gcc.target/i386/sse2-mmx-psubsb-2.c: New test case.
+	* gcc.target/i386/sse2-mmx-psubusb-2.c: New test case.
+
+2021-10-07  Patrick Palka  <ppalka@redhat.com>
+
+	PR c++/99904
+	* g++.dg/cpp2a/concepts-ttp4.C: New test.
+
+2021-10-07  Jonathan Wakely  <jwakely@redhat.com>
+
+	PR c++/102482
+	* g++.dg/warn/Winit-list5.C: New test.
+
+2021-10-07  Jan Hubicka  <hubicka@ucw.cz>
+
+	* g++.dg/torture/pr102581.C: New test.
+
+2021-10-07  Jakub Jelinek  <jakub@redhat.com>
+
+	PR c++/102615
+	* g++.dg/cpp23/charlit-encoding1.C: New testcase for C++23 P2316R2.
+
+2021-10-07  Richard Biener  <rguenther@suse.de>
+
+	* gcc.dg/gimplefe-47.c: New testcase.
+
 2021-10-06  Jason Merrill  <jason@redhat.com>
 
 	* g++.dg/cpp2a/spaceship-synth8a.C: New test.
diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
index 1d79930..7e9da8a 100644
--- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
+++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
@@ -190,7 +190,7 @@
   struct A1 a = { 1 };
   a.a[0] = 0;
   a.a[1] = 1;                    // { dg-warning "\\\[-Wstringop-overflow" }
-  a.a[2] = 2;                    // { dg-warning "\\\[-Wstringop-overflow" }
+  a.a[2] = 2;                    // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* } } }
   sink (&a);
 }
 
@@ -207,7 +207,7 @@
   struct A1 a = { 1, { } };
   a.a[0] = 0;
   a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
-  a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
+  a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* } } }
   sink (&a);
 }
 
@@ -221,10 +221,10 @@
   a1_1.a[1] = 1;                // { dg-warning "\\\[-Wstringop-overflow" }
   a1_1.a[2] = 2;                // { dg-warning "\\\[-Wstringop-overflow" }
 
-  struct A1 a = { 0, { 1 } };
+  struct A1 a = { 0, { 1 } };   // { dg-warning "\\\[-Wstringop-overflow" { target { i?86-*-* x86_64-*-* } } }
   a.a[0] = 0;
-  a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
-  a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
+  a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* } } }
+  a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* } } }
   sink (&a);
 }
 
@@ -289,7 +289,7 @@
   struct A1i a = { 0 };
   a.a[0] = 0;
   a.a[1] = 1;                    // { dg-warning "\\\[-Wstringop-overflow" }
-  a.a[2] = 2;                    // { dg-warning "\\\[-Wstringop-overflow" }
+  a.a[2] = 2;                    // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* } } }
   sink (&a);
 }
 
@@ -306,7 +306,7 @@
   struct A1 a = { 0, { } };
   a.a[0] = 0;
   a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
-  a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
+  a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* } } }
   sink (&a);
 }
 
@@ -320,10 +320,10 @@
   a1i_1.a[1] = 1;               // { dg-warning "\\\[-Wstringop-overflow" }
   a1i_1.a[2] = 2;               // { dg-warning "\\\[-Wstringop-overflow" }
 
-  struct A1 a = { 0, { 1 } };
+  struct A1 a = { 0, { 1 } };   // { dg-warning "\\\[-Wstringop-overflow" { target { i?86-*-* x86_64-*-* } } }
   a.a[0] = 1;
-  a.a[1] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
-  a.a[2] = 3;                   // { dg-warning "\\\[-Wstringop-overflow" }
+  a.a[1] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* } } }
+  a.a[2] = 3;                   // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* } } }
   sink (&a);
 }
 
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
index 39e32fd..bc14309 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -std=gnu++11 -fopt-info-loop-missed" } */
+/* { dg-options "-O2 -std=gnu++11 -fopt-info-loop-missed -fno-tree-vectorize" } */
 struct p
 {
   char *ay;
diff --git a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
index 49ee878..210e74c 100644
--- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
+++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
@@ -5,7 +5,7 @@
 struct shared_count {
   shared_count () { }
   shared_count (shared_count &r)
-    : pi (r.pi) { }     // { dg-warning "\\\[-Wuninitialized" }
+    : pi (r.pi) { }     // { dg-warning "\\\[-Wuninitialized" "" { xfail { i?86-*-* x86_64-*-* } } }
   int pi;
 };
 
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-51.c b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
index 6028b11..b0b8bdb 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
@@ -38,7 +38,7 @@
   } s;
 
   s.cvla[0] = __LINE__;
-  s.cvla[nelts - 1] = 0;
+  s.cvla[nelts - 1] = 0; // { dg-warning "\\\[-Wstringop-overflow" { target { i?86-*-* x86_64-*-* } } }
   s.cvla[nelts] = 0;  // { dg-warning "\\\[-Warray-bounds" }
 
   sink (&s);
diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-3.c b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
index cbf3e93..e2c47e1 100644
--- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
+++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
@@ -59,7 +59,7 @@
 
 /* Also verify that -Warray-bounds doesn't trigger for ordinary array
    parameters...  */
-#pragma GCC optimize "2"
+#pragma GCC optimize ("2")
 
 __attribute__ ((noipa)) void
 gca3 (char a[3])
@@ -77,7 +77,7 @@
 __attribute__ ((noipa)) void
 gcas3 (char a[static 3])
 {
-  a[0] = 0; a[1] = 1; a[2] = 2;
+  a[0] = 0; a[1] = 1; a[2] = 2; // { dg-warning "\\\[-Wstringop-overflow" { target { i?86-*-* x86_64-*-* } } }
   a[3] = 3;                   // { dg-warning "\\\[-Warray-bounds" }
 }
 
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
index d6201b0..b648f5b 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
@@ -35,8 +35,8 @@
 void test_int16 (void)
 {
   char *p = a4 + 1;
-  *(int16_t*)p = 0;
-  *(int16_t*)(p + 2) = 0;   // { dg-warning "writing 2 bytes into a region of size 1" }
+  *(int16_t*)p = 0;    // { dg-warning "writing 4 bytes into a region of size 3" { target { i?86-*-* x86_64-*-* } } }
+  *(int16_t*)(p + 2) = 0;   // { dg-warning "writing 2 bytes into a region of size 1" "" { xfail { i?86-*-* x86_64-*-* } } }
 }
 
 
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
index 3a27460..e88f7b4 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
@@ -23,10 +23,10 @@
 {
   char a[3];
   struct S0 *p = (struct S0*)a;
-  p->a = 0;
+  p->a = 0;                         // { dg-warning "\\\[-Wstringop-overflow" { target { i?86-*-* x86_64-*-* } } }
   p->b[0] = 0;
   p->b[1] = 1;                      // { dg-bogus "\\\[-Wstringop-overflow" }
-  p->b[2] = 2;                      // { dg-warning "\\\[-Wstringop-overflow" }
+  p->b[2] = 2;                      // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* } } }
   p->b[i] = 2;
   sink (p);
 }
@@ -50,10 +50,10 @@
 {
   char a[3];
   struct Sx *p = (struct Sx*)a;
-  p->a = 0;
+  p->a = 0;                         // { dg-warning "\\\[-Wstringop-overflow" { target { i?86-*-* x86_64-*-* } } }
   p->b[0] = 0;
   p->b[1] = 1;                      // { dg-bogus "\\\[-Wstringop-overflow" }
-  p->b[2] = 1;                      // { dg-warning "\\\[-Wstringop-overflow" }
+  p->b[2] = 1;                      // { dg-warning "\\\[-Wstringop-overflow" "" { xfail { i?86-*-* x86_64-*-* } } }
   p->b[i] = 2;
   sink (p);
 }
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
index 6bcba27..09df000 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
@@ -58,11 +58,11 @@
 void warn_comp_lit (void)
 {
   *(AC2*)a1 = Ac2;      // { dg-warning "writing 2 bytes into a region of size 1" "pr101475" { xfail *-*-* } }
-  *(AC4*)a2 = Ac4;      // { dg-warning "writing 4 bytes into a region of size 2" "pr101475" { xfail *-*-* } }
-  *(AC4*)a3 = Ac4;      // { dg-warning "writing 4 bytes into a region of size 3" "pr101475" { xfail *-*-* } }
-  *(AC8*)a4 = Ac8;      // { dg-warning "writing 8 bytes into a region of size 4" "pr101475" { xfail *-*-* } }
-  *(AC8*)a7 = Ac8;      // { dg-warning "writing 8 bytes into a region of size 7" "pr101475" { xfail *-*-* } }
-  *(AC16*)a15 = Ac16;   // { dg-warning "writing 16 bytes into a region of size 15" "pr101475" { xfail *-*-* } }
+  *(AC4*)a2 = Ac4;      // { dg-warning "writing 4 bytes into a region of size 2" "pr101475" { xfail { ! { i?86-*-* x86_64-*-* } } } }
+  *(AC4*)a3 = Ac4;      // { dg-warning "writing 4 bytes into a region of size 3" "pr101475" { xfail { ! { i?86-*-* x86_64-*-* } } } }
+  *(AC8*)a4 = Ac8;      // { dg-warning "writing 8 bytes into a region of size 4" "pr101475" { xfail { ! { i?86-*-* x86_64-*-* } } } }
+  *(AC8*)a7 = Ac8;      // { dg-warning "writing 8 bytes into a region of size 7" "pr101475" { xfail { ! { i?86-*-* x86_64-*-* } } } }
+  *(AC16*)a15 = Ac16;   // { dg-warning "writing 16 bytes into a region of size 15" "pr101475" { xfail { ! { i?86-*-* x86_64-*-* } } } }
 }
 
 void warn_aggr_decl (void)
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-76.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-76.c
index 18191a1..30b1c9a 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-76.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-76.c
@@ -16,7 +16,7 @@
    to the larger of the two objects and mentions the offset into it
    (although the offset might be better included in the warning).  */
 extern char a3[3];
-extern char a5[5];  // { dg-message "at offset 5 into destination object 'a5' of size 5" "note" }
+extern char a5[5];  // { dg-message "at offset \[^a-zA-Z\n\r\]*5\[^a-zA-Z0-9\]* into destination object 'a5' of size 5" "note" }
 
 void max_a3_a5 (int i)
 {
@@ -27,16 +27,16 @@
      by its own warning independently of -Wstringop-overflow.  */
   char *d = MAX (p, q);
 
-  d[2] = 0;
+  d[2] = 0;         // { dg-warning "writing 4 bytes into a region of size 3" { target { i?86-*-* x86_64-*-* } } }
   d[3] = 0;
   d[4] = 0;
-  d[5] = 0;         // { dg-warning "writing 1 byte into a region of size 0" }
+  d[5] = 0;         // { dg-warning "writing 1 byte into a region of size 0" "" { xfail { i?86-*-* x86_64-*-* } } }
 }
 
 
 // Same as above but with the larger array as the first MAX_EXPR operand.
 extern char b4[4];
-extern char b6[6];  // { dg-message "at offset 6 into destination object 'b6' of size 6" "note" }
+extern char b6[6];  // { dg-message "at offset \[^a-zA-Z\n\r\]*6\[^a-zA-Z0-9\]* into destination object 'b6' of size 6" "note" }
 
 void max_b6_b4 (int i)
 {
@@ -44,10 +44,10 @@
   char *q = b4 + i;
   char *d = MAX (p, q);
 
-  d[3] = 0;
+  d[3] = 0;         // { dg-warning "writing 4 bytes into a region of size 3" { target { i?86-*-* x86_64-*-* } } }
   d[4] = 0;
   d[5] = 0;
-  d[6] = 0;         // { dg-warning "writing 1 byte into a region of size 0" }
+  d[6] = 0;         // { dg-warning "writing 1 byte into a region of size 0" "" { xfail { i?86-*-* x86_64-*-* } } }
 }
 
 
@@ -82,7 +82,7 @@
 struct A3_5
 {
   char a3[3];  // { dg-message "at offset 3 into destination object 'a3' of size 3" "pr??????" { xfail *-*-* } }
-  char a5[5];  // { dg-message "at offset 5 into destination object 'a5' of size 5" "note" }
+  char a5[5];  // { dg-message "at offset 5 into destination object 'a5' of size 5" "note" { xfail { i?86-*-* x86_64-*-* } } }
 };
 
 void max_A3_A5 (int i, struct A3_5 *pa3_5)
@@ -95,14 +95,14 @@
   d[2] = 0;
   d[3] = 0;         // { dg-warning "writing 1 byte into a region of size 0" "pr??????" { xfail *-*-* } }
   d[4] = 0;
-  d[5] = 0;         // { dg-warning "writing 1 byte into a region of size 0" }
+  d[5] = 0;         // { dg-warning "writing 1 byte into a region of size 0" "" { xfail { i?86-*-* x86_64-*-* } } }
 }
 
 
 struct B4_B6
 {
   char b4[4];
-  char b6[6];       // { dg-message "at offset 6 into destination object 'b6' of size 6" "note" }
+  char b6[6];       // { dg-message "at offset \[^a-zA-Z\n\r\]*6\[^a-zA-Z0-9\]* into destination object 'b6' of size 6" "note" { xfail { i?86-*-* x86_64-*-* } } }
 };
 
 void max_B6_B4 (int i, struct B4_B6 *pb4_b6)
@@ -114,7 +114,7 @@
   d[3] = 0;
   d[4] = 0;
   d[5] = 0;
-  d[6] = 0;         // { dg-warning "writing 1 byte into a region of size 0" }
+  d[6] = 0;         // { dg-warning "writing 1 byte into a region of size 0" "" { xfail { i?86-*-* x86_64-*-* } } }
 }
 
 
diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
index e110880..2e56261 100644
--- a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
+++ b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fopenmp -std=c99 -fipa-pta -fdump-tree-optimized" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fopenmp -std=c99 -fipa-pta -fdump-tree-optimized" } */
 
 #define N 2
 
diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-3.c b/gcc/testsuite/gcc.dg/gomp/pr46032-3.c
index a4af7ec..da1ab48 100644
--- a/gcc/testsuite/gcc.dg/gomp/pr46032-3.c
+++ b/gcc/testsuite/gcc.dg/gomp/pr46032-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fopenmp -std=c99 -fipa-pta -fdump-tree-optimized" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fopenmp -std=c99 -fipa-pta -fdump-tree-optimized" } */
 
 #define N 2
 
diff --git a/gcc/testsuite/gcc.dg/gomp/simd-2.c b/gcc/testsuite/gcc.dg/gomp/simd-2.c
index 85acb98..f491212 100644
--- a/gcc/testsuite/gcc.dg/gomp/simd-2.c
+++ b/gcc/testsuite/gcc.dg/gomp/simd-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fopenmp -fdump-tree-vect-details" } */
+/* { dg-options "-O2 -fopenmp -fvect-cost-model=cheap -fdump-tree-vect-details" } */
 /* { dg-additional-options "-msse2" { target { i?86-*-* x86_64-*-* } } } */
 /* { dg-additional-options "-mavx" { target avx } } */
 /* { dg-final { scan-tree-dump-times "vectorized \[1-9]\[0-9]* loops in function" 5 "vect" { target i?86-*-* x86_64-*-* aarch64-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/gomp/simd-3.c b/gcc/testsuite/gcc.dg/gomp/simd-3.c
index 86fee85..c75060c 100644
--- a/gcc/testsuite/gcc.dg/gomp/simd-3.c
+++ b/gcc/testsuite/gcc.dg/gomp/simd-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fopenmp -fdump-tree-vect-details" } */
+/* { dg-options "-O2 -fopenmp -fvect-cost-model=cheap -fdump-tree-vect-details" } */
 /* { dg-additional-options "-msse2" { target { i?86-*-* x86_64-*-* } } } */
 /* { dg-additional-options "-mavx" { target avx } } */
 /* { dg-final { scan-tree-dump-times "vectorized \[1-9]\[0-9]* loops in function" 5 "vect" { target i?86-*-* x86_64-*-* aarch64-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/fuse-1.c b/gcc/testsuite/gcc.dg/graphite/fuse-1.c
index 527b6e5..61289d3 100644
--- a/gcc/testsuite/gcc.dg/graphite/fuse-1.c
+++ b/gcc/testsuite/gcc.dg/graphite/fuse-1.c
@@ -1,6 +1,6 @@
 /* Check that the two loops are fused and that we manage to fold the two xor
    operations.  */
-/* { dg-options "-O2 -floop-nest-optimize -fdump-tree-forwprop4 -fdump-tree-graphite-all" } */
+/* { dg-options "-O2 -fno-tree-vectorize -floop-nest-optimize -fdump-tree-forwprop4 -fdump-tree-graphite-all" } */
 
 /* Make sure we fuse the loops like this:
 AST generated by isl:
diff --git a/gcc/testsuite/gcc.dg/pr67089-6.c b/gcc/testsuite/gcc.dg/pr67089-6.c
index db2ffdf..b59d75b 100644
--- a/gcc/testsuite/gcc.dg/pr67089-6.c
+++ b/gcc/testsuite/gcc.dg/pr67089-6.c
@@ -1,6 +1,6 @@
 /* PR target/67089 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftree-loop-if-convert -fdump-tree-widening_mul" } */
+/* { dg-options "-O2 -fno-tree-vectorize -ftree-loop-if-convert -fdump-tree-widening_mul" } */
 
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.dg/pr82929-2.c b/gcc/testsuite/gcc.dg/pr82929-2.c
index 3442f91..b886f1c 100644
--- a/gcc/testsuite/gcc.dg/pr82929-2.c
+++ b/gcc/testsuite/gcc.dg/pr82929-2.c
@@ -1,6 +1,6 @@
 /* PR tree-optimization/82929 */
 /* { dg-do compile { target store_merge } } */
-/* { dg-options "-O2 -fdump-tree-store-merging" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" } */
 
 void
 foo (short *p, short *q, short *r)
diff --git a/gcc/testsuite/gcc.dg/pr82929.c b/gcc/testsuite/gcc.dg/pr82929.c
index bb84f2b..123e191 100644
--- a/gcc/testsuite/gcc.dg/pr82929.c
+++ b/gcc/testsuite/gcc.dg/pr82929.c
@@ -1,6 +1,6 @@
 /* PR tree-optimization/82929 */
 /* { dg-do compile { target store_merge } } */
-/* { dg-options "-O2 -fdump-tree-store-merging" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" } */
 
 void
 foo (short *p, short *q, short *r)
diff --git a/gcc/testsuite/gcc.dg/store_merging_1.c b/gcc/testsuite/gcc.dg/store_merging_1.c
index 4cc43df..91ca925 100644
--- a/gcc/testsuite/gcc.dg/store_merging_1.c
+++ b/gcc/testsuite/gcc.dg/store_merging_1.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target store_merge } */
-/* { dg-options "-O2 -fdump-tree-store-merging" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" } */
 
 struct bar {
   int a;
diff --git a/gcc/testsuite/gcc.dg/store_merging_11.c b/gcc/testsuite/gcc.dg/store_merging_11.c
index 2ec2394..60ed5cd 100644
--- a/gcc/testsuite/gcc.dg/store_merging_11.c
+++ b/gcc/testsuite/gcc.dg/store_merging_11.c
@@ -1,6 +1,6 @@
 /* { dg-do run } */
 /* { dg-require-effective-target store_merge } */
-/* { dg-options "-O2 -fdump-tree-store-merging" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" } */
 
 struct S { unsigned char b[2]; unsigned short c; unsigned char d[4]; unsigned long e; };
 
diff --git a/gcc/testsuite/gcc.dg/store_merging_13.c b/gcc/testsuite/gcc.dg/store_merging_13.c
index a053f21..6e5206d 100644
--- a/gcc/testsuite/gcc.dg/store_merging_13.c
+++ b/gcc/testsuite/gcc.dg/store_merging_13.c
@@ -1,6 +1,6 @@
 /* { dg-do run } */
 /* { dg-require-effective-target store_merge } */
-/* { dg-options "-O2 -fdump-tree-store-merging" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" } */
 
 struct S { unsigned char a, b; unsigned short c; unsigned char d, e, f, g; unsigned long long h; };
 
diff --git a/gcc/testsuite/gcc.dg/store_merging_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
index acd7de5..13fcca4 100644
--- a/gcc/testsuite/gcc.dg/store_merging_15.c
+++ b/gcc/testsuite/gcc.dg/store_merging_15.c
@@ -1,6 +1,6 @@
 /* { dg-do run } */
 /* { dg-require-effective-target store_merge } */
-/* { dg-options "-O2 -fdump-tree-store-merging" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" } */
 
 struct S { unsigned char a, b; unsigned short c; unsigned char d, e, f, g; unsigned long long h; };
 
diff --git a/gcc/testsuite/gcc.dg/store_merging_16.c b/gcc/testsuite/gcc.dg/store_merging_16.c
index 9545dcc..cd83f1c 100644
--- a/gcc/testsuite/gcc.dg/store_merging_16.c
+++ b/gcc/testsuite/gcc.dg/store_merging_16.c
@@ -2,7 +2,7 @@
    are either big or little endian (not pdp endian).  */
 /* { dg-do run { target { lp64 && { i?86-*-* x86_64-*-* powerpc*-*-* aarch64*-*-* } } } } */
 /* { dg-require-effective-target store_merge } */
-/* { dg-options "-O2 -fdump-tree-store-merging" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" } */
 
 __attribute__((noipa)) void
 f1 (unsigned char *p, unsigned long long q)
diff --git a/gcc/testsuite/gcc.dg/store_merging_19.c b/gcc/testsuite/gcc.dg/store_merging_19.c
index 0841bb4..0a2bbc4 100644
--- a/gcc/testsuite/gcc.dg/store_merging_19.c
+++ b/gcc/testsuite/gcc.dg/store_merging_19.c
@@ -1,6 +1,6 @@
 /* PR tree-optimization/83843 */
 /* { dg-do run } */
-/* { dg-options "-O2 -fdump-tree-store-merging" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" } */
 /* { dg-final { scan-tree-dump-times "Merging successful" 3 "store-merging" { target store_merge } } } */
 
 __attribute__((noipa)) void
diff --git a/gcc/testsuite/gcc.dg/store_merging_24.c b/gcc/testsuite/gcc.dg/store_merging_24.c
index 744fe60..5291bb9 100644
--- a/gcc/testsuite/gcc.dg/store_merging_24.c
+++ b/gcc/testsuite/gcc.dg/store_merging_24.c
@@ -1,6 +1,6 @@
 /* PR tree-optimization/87859 */
 /* { dg-do run } */
-/* { dg-options "-O2 -fdump-tree-store-merging-details" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging-details" } */
 /* { dg-final { scan-tree-dump "New sequence of \[23] stores to replace old one of 19 stores" "store-merging" { target i?86-*-* x86_64-*-* } } } */
 /* { dg-final { scan-tree-dump "New sequence of 1 stores to replace old one of 6 stores" "store-merging" { target i?86-*-* x86_64-*-* } } } */
 
diff --git a/gcc/testsuite/gcc.dg/store_merging_25.c b/gcc/testsuite/gcc.dg/store_merging_25.c
index cf18219..96611b5 100644
--- a/gcc/testsuite/gcc.dg/store_merging_25.c
+++ b/gcc/testsuite/gcc.dg/store_merging_25.c
@@ -1,6 +1,6 @@
 /* PR tree-optimization/87859 */
 /* { dg-do run } */
-/* { dg-options "-O2 -fdump-tree-store-merging-details" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging-details" } */
 /* { dg-final { scan-tree-dump "New sequence of \[23] stores to replace old one of 14 stores" "store-merging" { target i?86-*-* x86_64-*-* } } } */
 /* { dg-final { scan-tree-dump "New sequence of 1 stores to replace old one of 6 stores" "store-merging" { target i?86-*-* x86_64-*-* } } } */
 
diff --git a/gcc/testsuite/gcc.dg/store_merging_28.c b/gcc/testsuite/gcc.dg/store_merging_28.c
index 2d6cffc4..fadb7ff 100644
--- a/gcc/testsuite/gcc.dg/store_merging_28.c
+++ b/gcc/testsuite/gcc.dg/store_merging_28.c
@@ -1,7 +1,7 @@
 /* PR tree-optimization/88709 */
 /* { dg-do compile } */
 /* { dg-require-effective-target store_merge } */
-/* { dg-options "-O2 -fno-ipa-icf -fdump-tree-store-merging-details" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fno-ipa-icf -fdump-tree-store-merging-details" } */
 /* { dg-final { scan-tree-dump-times "New sequence of \[24] stores to replace old one of 16 stores" 8 "store-merging" { target { i?86-*-* x86_64-*-* } } } } */
 /* { dg-final { scan-tree-dump-times "New sequence of \[24] stores to replace old one of 6 stores" 1 "store-merging" { target { ! arm*-*-* } } } } */
 
diff --git a/gcc/testsuite/gcc.dg/store_merging_30.c b/gcc/testsuite/gcc.dg/store_merging_30.c
index 694d560..baf94ef 100644
--- a/gcc/testsuite/gcc.dg/store_merging_30.c
+++ b/gcc/testsuite/gcc.dg/store_merging_30.c
@@ -1,7 +1,7 @@
 /* PR tree-optimization/94573 */
 /* { dg-do compile } */
 /* { dg-require-effective-target store_merge } */
-/* { dg-options "-O2 -fdump-tree-store-merging-details" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging-details" } */
 /* { dg-final { scan-tree-dump "New sequence of 4 stores to replace old one of 8 stores" "store-merging" { target lp64 } } } */
 
 int var[43][12];
diff --git a/gcc/testsuite/gcc.dg/store_merging_5.c b/gcc/testsuite/gcc.dg/store_merging_5.c
index 6e7c725..b0cb0da 100644
--- a/gcc/testsuite/gcc.dg/store_merging_5.c
+++ b/gcc/testsuite/gcc.dg/store_merging_5.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target store_merge } */
-/* { dg-options "-O2 -fdump-tree-store-merging" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" } */
 
 /* Make sure that non-aliasing non-constant interspersed stores do not
    stop chains.  */
diff --git a/gcc/testsuite/gcc.dg/store_merging_7.c b/gcc/testsuite/gcc.dg/store_merging_7.c
index c744ece..dbe000a 100644
--- a/gcc/testsuite/gcc.dg/store_merging_7.c
+++ b/gcc/testsuite/gcc.dg/store_merging_7.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target store_merge } */
-/* { dg-options "-O2 -fdump-tree-store-merging" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" } */
 
 /* Check that we can merge consecutive array members through the pointer.
    PR rtl-optimization/23684.  */
diff --git a/gcc/testsuite/gcc.dg/store_merging_8.c b/gcc/testsuite/gcc.dg/store_merging_8.c
index e710a54..d719e0a 100644
--- a/gcc/testsuite/gcc.dg/store_merging_8.c
+++ b/gcc/testsuite/gcc.dg/store_merging_8.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target store_merge } */
-/* { dg-options "-O2 -fdump-tree-store-merging" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" } */
 
 struct baz {
   struct bar {
diff --git a/gcc/testsuite/gcc.dg/strlenopt-85.c b/gcc/testsuite/gcc.dg/strlenopt-85.c
index e049e0c..2ba1ee05 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-85.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-85.c
@@ -4,7 +4,7 @@
    of memory allocated by calloc() even if one or more nul bytes are
    written into it.
    { dg-do compile }
-   { dg-options "-O2 -fdump-tree-optimized" } */
+   { dg-options "-O2 -fno-tree-vectorize -fdump-tree-optimized" } */
 
 unsigned n0, n1;
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/dump-6.c b/gcc/testsuite/gcc.dg/tree-ssa/dump-6.c
index 70659c00..6c80390 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/dump-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/dump-6.c
@@ -1,6 +1,6 @@
 /* PR middle-end/90676 - default GIMPLE dumps lack information
    { dg-do compile }
-   { dg-options "-O2 -fdump-tree-store-merging" }
+   { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" }
    { dg-require-effective-target int32plus }
    { dg-require-effective-target store_merge } */
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c
index 50d86a0..b9e40e9 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fopt-info-loop-missed" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fopt-info-loop-missed" } */
 extern void g(void);
 
 void
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr47059.c b/gcc/testsuite/gcc.dg/tree-ssa/pr47059.c
index 9f9c61a..860cde1 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr47059.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr47059.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-Os -fdump-tree-optimized" } */
+/* { dg-options "-Os -fno-tree-vectorize -fdump-tree-optimized" } */
 
 
 struct struct1
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr86017.c b/gcc/testsuite/gcc.dg/tree-ssa/pr86017.c
index f216e83..c7ef73a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr86017.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr86017.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-store-merging" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" } */
 
 void f (void*);
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr91482.c b/gcc/testsuite/gcc.dg/tree-ssa/pr91482.c
index 7d6a724..0ddad57 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr91482.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr91482.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-ccp1 -fdump-tree-store-merging" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-ccp1 -fdump-tree-store-merging" } */
 
 void write64 (void *p)
 {
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c b/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c
index f68be2b..8c3d9a4 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-do run } */
-/* { dg-options "-O2 -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */
+/* { dg-options "-O2 -fno-tree-vectorize -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */
 
 void abort (void);
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c b/gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c
index ec08d6c..1fc8f08 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -fno-inline -fno-tree-loop-distribute-patterns -fpredictive-commoning -fdump-tree-pcom-details" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fno-inline -fno-tree-loop-distribute-patterns -fpredictive-commoning -fdump-tree-pcom-details" } */
 
 int arr1[105] = {2, 3, 5, 7, 11, 13, 0};
 int arr2[105] = {2, 3, 5, 7, 11, 13, 0};
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c b/gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c
index 467903b..46f0d0c 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c
@@ -1,7 +1,7 @@
 /* Prefetching used to prefer nonsensical unroll factor of 5 in this testcase.  */
 
 /* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-options "-O2 -fprefetch-loop-arrays -march=amdfam10 -fdump-tree-aprefetch-details" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fprefetch-loop-arrays -march=amdfam10 -fdump-tree-aprefetch-details" } */
 
 #define N 1000000
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c b/gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c
index 12f0901..3fa7168 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-options "-O2 -fprefetch-loop-arrays -march=amdfam10 --param simultaneous-prefetches=100 --param min-insn-to-prefetch-ratio=6 -fdump-tree-aprefetch-details" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fprefetch-loop-arrays -march=amdfam10 --param simultaneous-prefetches=100 --param min-insn-to-prefetch-ratio=6 -fdump-tree-aprefetch-details" } */
 
 #define N 1000
 #define K 900
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c b/gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c
index cbd6a80..00f41c3 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-options "-O2 -fno-tree-loop-distribute-patterns -fprefetch-loop-arrays -march=amdfam10 --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fno-tree-loop-distribute-patterns -fprefetch-loop-arrays -march=amdfam10 --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */
 
 #define K 1000000
 int a[K];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c b/gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c
index da48473..e8848c3 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-options "-O2 -fno-tree-loop-distribute-patterns -fprefetch-loop-arrays -march=amdfam10 --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fno-tree-loop-distribute-patterns -fprefetch-loop-arrays -march=amdfam10 --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */
 
 #define K 1000000
 int a[K], b[K];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c
index 92b2df8..2e7b5b4 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-optimized" } */
 int g(_Complex int*);
 int f(void)
 {
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c
index 718b746..7bb8d06 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-optimized" } */
 int g(_Complex int*);
 int f(void)
 {
diff --git a/gcc/testsuite/gcc.dg/uninit-40.c b/gcc/testsuite/gcc.dg/uninit-40.c
index c015191..8708079 100644
--- a/gcc/testsuite/gcc.dg/uninit-40.c
+++ b/gcc/testsuite/gcc.dg/uninit-40.c
@@ -1,6 +1,6 @@
 /* PR tree-optimization/98597 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wuninitialized" } */
+/* { dg-options "-O2 -fno-tree-vectorize -Wuninitialized" } */
 
 union U { double d; int i; float f; };
 struct S { char a; int b; char c; unsigned d; union U e; int f[3]; unsigned g[3]; };
diff --git a/gcc/testsuite/gcc.dg/unroll-7.c b/gcc/testsuite/gcc.dg/unroll-7.c
index 055369b..695af57 100644
--- a/gcc/testsuite/gcc.dg/unroll-7.c
+++ b/gcc/testsuite/gcc.dg/unroll-7.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-rtl-loop2_unroll-details -funroll-loops" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-rtl-loop2_unroll-details -funroll-loops" } */
 /* { dg-require-effective-target int32plus } */
 
 extern int *a;
diff --git a/gcc/testsuite/gcc.misc-tests/help.exp b/gcc/testsuite/gcc.misc-tests/help.exp
index 5e034d2..eb6d868 100644
--- a/gcc/testsuite/gcc.misc-tests/help.exp
+++ b/gcc/testsuite/gcc.misc-tests/help.exp
@@ -79,7 +79,7 @@
 check_for_options c "--help=warnings,^joined,^undocumented" "" "" ""
 check_for_options c "-Q -O2 --help=optimizers" {
 -O
--ftree-loop-vectorize[^\n]*disabled
+-ftree-loop-vectorize[^\n]*enabled
 } "  -g  " ""
 check_for_options c "-Q -O3 --help=optimizers" {
 -O
diff --git a/gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c b/gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c
index 709cd21..a732bc4 100644
--- a/gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -mavx512vpopcntdq -mavx512bw -mavx512vl" } */
+/* { dg-options "-O2 -fno-tree-vectorize -mavx512vpopcntdq -mavx512bw -mavx512vl" } */
 /* { dg-require-effective-target avx512vl } */
 /* { dg-require-effective-target avx512vpopcntdqvl } */
 /* { dg-require-effective-target avx512bw } */
diff --git a/gcc/testsuite/gcc.target/i386/mmx-reduce-op-1.c b/gcc/testsuite/gcc.target/i386/mmx-reduce-op-1.c
new file mode 100644
index 0000000..ac20ed0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mmx-reduce-op-1.c
@@ -0,0 +1,58 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump-times "\.REDUC_PLUS" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\.REDUC_MIN" 2 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\.REDUC_MAX" 2 "optimized" } } */
+
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#define MIN(a, b) ((a) > (b) ? (b) : (a))
+
+short
+__attribute__((noipa, optimize("Ofast"),target("sse2")))
+reduce_add (short* __restrict pa)
+{
+  short sum = 0;
+  for (int i = 0; i != 4; i++)
+    sum += pa[i];
+  return sum;
+}
+
+short
+__attribute__((noipa, optimize("Ofast"),target("sse2")))
+reduce_smax (short* __restrict pa)
+{
+  short sum = pa[0];
+  for (int i = 0; i != 4; i++)
+    sum = MAX(sum, pa[i]);
+  return sum;
+}
+
+short
+__attribute__((noipa, optimize("Ofast"),target("sse2")))
+reduce_smin (short* __restrict pa)
+{
+  short sum = pa[0];
+  for (int i = 0; i != 4; i++)
+    sum = MIN(sum, pa[i]);
+  return sum;
+}
+
+unsigned short
+__attribute__((noipa, optimize("Ofast"),target("sse4.1")))
+reduce_umax (unsigned short* __restrict pa)
+{
+  unsigned short sum = pa[0];
+  for (int i = 0; i != 4; i++)
+    sum = MAX(sum, pa[i]);
+  return sum;
+}
+
+unsigned short
+__attribute__((noipa, optimize("Ofast"),target("sse4.1")))
+reduce_umin (unsigned short* __restrict pa)
+{
+  unsigned short sum = pa[0];
+  for (int i = 0; i != 4; i++)
+    sum = MIN(sum, pa[i]);
+  return sum;
+}
diff --git a/gcc/testsuite/gcc.target/i386/mmx-reduce-op-2.c b/gcc/testsuite/gcc.target/i386/mmx-reduce-op-2.c
new file mode 100644
index 0000000..0896cd6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mmx-reduce-op-2.c
@@ -0,0 +1,25 @@
+/* { dg-do run { target { ! ia32 } } } */
+/* { dg-require-effective-target sse4 } */
+/* { dg-options "-O2 -msse4.1" } */
+
+#include "sse4_1-check.h"
+
+#include "mmx-reduce-op-1.c"
+
+static void
+sse4_1_test ()
+{
+  short p[4] = { -103, 23, 41, 200 };
+  unsigned short up[4] = { 100, 30, 299, 1000 };
+
+  if (reduce_add (p) != 161)
+    abort ();
+  if (reduce_smin (p) != -103)
+    abort ();
+  if (reduce_smax (p) != 200)
+    abort ();
+  if (reduce_umin (up) != 30)
+    abort ();
+  if (reduce_umax (up) != 1000)
+    abort();
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr102464.c b/gcc/testsuite/gcc.target/i386/pr102464.c
new file mode 100644
index 0000000..e3e060e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr102464.c
@@ -0,0 +1,39 @@
+/* PR target/102464.  */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx512fp16" } */
+
+#define FOO(FUNC,SUFFIX)                       \
+  _Float16                                     \
+  foo_##FUNC##_##SUFFIX (_Float16 a)           \
+  {                                            \
+    return __builtin_##FUNC##SUFFIX (a);       \
+  }
+
+FOO (roundeven, f16);
+FOO (roundeven, f);
+FOO (roundeven, );
+FOO (roundeven, l);
+FOO (trunc, f16);
+FOO (trunc, f);
+FOO (trunc, );
+FOO (trunc, l);
+FOO (ceil, f16);
+FOO (ceil, f);
+FOO (ceil, );
+FOO (ceil, l);
+FOO (floor, f16);
+FOO (floor, f);
+FOO (floor, );
+FOO (floor, l);
+FOO (nearbyint, f16);
+FOO (nearbyint, f);
+FOO (nearbyint, );
+FOO (nearbyint, l);
+FOO (rint, f16);
+FOO (rint, f);
+FOO (rint, );
+FOO (rint, l);
+
+/* { dg-final { scan-assembler-not "vcvtsh2s\[sd\]" } } */
+/* { dg-final { scan-assembler-not "extendhfxf" } } */
+/* { dg-final { scan-assembler-times "vrndscalesh\[^\n\r\]*xmm\[0-9\]" 24 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
index d0cffa05..1c1f0ee 100644
--- a/gcc/testsuite/gcc.target/i386/pr34012.c
+++ b/gcc/testsuite/gcc.target/i386/pr34012.c
@@ -1,7 +1,7 @@
 /* PR rtl-optimization/34012 */
 /* { dg-do compile } */
 /* { dg-require-effective-target lp64 } */
-/* { dg-options "-O2 -fno-store-merging" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fno-store-merging" } */
 
 void bar (long int *);
 void
diff --git a/gcc/testsuite/gcc.target/i386/pr49781-1.c b/gcc/testsuite/gcc.target/i386/pr49781-1.c
index 60f9d50..d5a2e32 100644
--- a/gcc/testsuite/gcc.target/i386/pr49781-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr49781-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fpic -mtune=generic" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fpic -mtune=generic" } */
 /* { dg-require-effective-target fpic } */
 
 static int heap[2*(256 +1+29)+1];
diff --git a/gcc/testsuite/gcc.target/i386/pr95798-1.c b/gcc/testsuite/gcc.target/i386/pr95798-1.c
index 9a7e32d..526f489 100644
--- a/gcc/testsuite/gcc.target/i386/pr95798-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr95798-1.c
@@ -1,6 +1,6 @@
 /* PR target/95798 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -masm=att -fomit-frame-pointer" } */
+/* { dg-options "-O2 -fno-tree-vectorize -masm=att -fomit-frame-pointer" } */
 /* { dg-final { scan-assembler "1, 8\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */
 /* { dg-final { scan-assembler "2, 16\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */
 /* { dg-final { scan-assembler "3, 24\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95798-2.c b/gcc/testsuite/gcc.target/i386/pr95798-2.c
index c670d37..6b5c5a7 100644
--- a/gcc/testsuite/gcc.target/i386/pr95798-2.c
+++ b/gcc/testsuite/gcc.target/i386/pr95798-2.c
@@ -1,6 +1,6 @@
 /* PR target/95798 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -masm=att -fomit-frame-pointer" } */
+/* { dg-options "-O2 -fno-tree-vectorize -masm=att -fomit-frame-pointer" } */
 /* { dg-final { scan-assembler "1, 8\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */
 /* { dg-final { scan-assembler "2, 16\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */
 /* { dg-final { scan-assembler "3, 24\\\(%rsp,%r\[a-z0-9]*,8\\\)" { target lp64 } } } */
diff --git a/gcc/testsuite/gfortran.dg/pr77498.f b/gcc/testsuite/gfortran.dg/pr77498.f
index f957b57..a0fc827 100644
--- a/gcc/testsuite/gfortran.dg/pr77498.f
+++ b/gcc/testsuite/gfortran.dg/pr77498.f
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "-O2 -ffast-math -fdump-tree-pre" }
+! { dg-options "-O2 -fno-tree-vectorize -ffast-math -fdump-tree-pre" }
 
       subroutine foo(U,V,R,N,A)
       integer N
diff --git a/libgcc/config/i386/morestack.S b/libgcc/config/i386/morestack.S
index 718dbb1..2e748ed 100644
--- a/libgcc/config/i386/morestack.S
+++ b/libgcc/config/i386/morestack.S
@@ -23,6 +23,7 @@
 # see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 # <http://www.gnu.org/licenses/>.
 
+#include "auto-host.h"
 
 # Support for allocating more stack space when using -fsplit-stack.
 # When a function discovers that it needs more stack space, it will
@@ -75,7 +76,7 @@
 # The amount of extra space we ask for.  In general this has to be
 # enough for the dynamic loader to find a symbol and for a signal
 # handler to run.
-	
+
 #ifndef __x86_64__
 #define BACKOFF (1024)
 #else
@@ -160,7 +161,7 @@
 	cmpb	$0x55,1(%eax)
 	je	2f
 
-3:	
+3:
 	movl	%eax,4(%esp)		# Update return address.
 
 	popl	%eax			# Restore %eax and stack.
@@ -426,7 +427,7 @@
 
 # This is the cleanup code called by the stack unwinder when unwinding
 # through the code between .LEHB0 and .LEHE0 above.
-	
+
 .L1:
 	.cfi_restore_state
 	subl	$16,%esp		# Maintain 16 byte alignment.
@@ -600,7 +601,7 @@
 
 # This is the cleanup code called by the stack unwinder when unwinding
 # through the code between .LEHB0 and .LEHE0 above.
-	
+
 .L1:
 	.cfi_restore_state
 	subq	$16,%rsp		# Maintain 16 byte alignment.
@@ -848,7 +849,11 @@
 # Make __stack_split_initialize a high priority constructor.  FIXME:
 # This is ELF specific.
 
+#if HAVE_INITFINI_ARRAY_SUPPORT
+	.section	.init_array.00000,"aw",@progbits
+#else
 	.section	.ctors.65535,"aw",@progbits
+#endif
 
 #ifndef __LP64__
 	.align	4
diff --git a/libgcc/config/rs6000/morestack.S b/libgcc/config/rs6000/morestack.S
index a2e255e..509e506 100644
--- a/libgcc/config/rs6000/morestack.S
+++ b/libgcc/config/rs6000/morestack.S
@@ -24,6 +24,8 @@
 # see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 # <http://www.gnu.org/licenses/>.
 
+#include <auto-host.h>
+
 #if _CALL_ELF == 2
 	.abiversion 2
 #define PARAMS 32
@@ -396,7 +398,11 @@
 
 
 # Make __stack_split_initialize a high priority constructor.
+#if HAVE_INITFINI_ARRAY_SUPPORT
+	.section .init_array.00000,"aw",@progbits
+#else
 	.section .ctors.65535,"aw",@progbits
+#endif
 	.p2align 3
 	.quad __stack_split_initialize
 	.quad __morestack_load_mmap
diff --git a/libgcc/config/s390/morestack.S b/libgcc/config/s390/morestack.S
index 80349fd..d873de9 100644
--- a/libgcc/config/s390/morestack.S
+++ b/libgcc/config/s390/morestack.S
@@ -28,6 +28,8 @@
 # also cover signal frame size.
 #define BACKOFF 0x1000
 
+#include <auto-host.h>
+
 # The __morestack function.
 
 	.global	__morestack
@@ -594,7 +596,11 @@
 
 # Make __stack_split_initialize a high priority constructor.
 
+#if HAVE_INITFINI_ARRAY_SUPPORT
+	.section .init_array.00000,"aw",@progbits
+#else
 	.section .ctors.65535,"aw",@progbits
+#endif
 
 #ifndef __LP64__
 	.align	4
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index daafc57..1a7bb78 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,54 @@
+2021-10-07  Jonathan Wakely  <jwakely@redhat.com>
+
+	* include/Makefile.am: Add new header.
+	* include/Makefile.in: Regenerate.
+	* include/std/chrono (duration, time_point, system_clock)
+	(steady_clock, high_resolution_clock, chrono_literals, sys_time)
+	(file_clock, file_time): Move to ...
+	* include/bits/chrono.h: New file.
+	* include/bits/atomic_futex.h: Include new header instead of
+	<chrono>.
+	* include/bits/atomic_timed_wait.h: Likewise.
+	* include/bits/fs_fwd.h: Likewise.
+	* include/bits/semaphore_base.h: Likewise.
+	* include/bits/this_thread_sleep.h: Likewise.
+	* include/bits/unique_lock.h: Likewise.
+	* include/experimental/bits/fs_fwd.h: Likewise.
+	* include/experimental/chrono: Likewise.
+	* include/experimental/io_context: Likewise.
+	* include/experimental/netfwd: Likewise.
+	* include/experimental/timer: Likewise.
+	* include/std/condition_variable: Likewise.
+	* include/std/mutex: Likewise.
+	* include/std/shared_mutex: Likewise.
+
+2021-10-07  Jonathan Wakely  <jwakely@redhat.com>
+
+	PR libstdc++/102377
+	* include/bits/atomic_wait.h (__waiter_pool_base:_S_align):
+	Hardcode to 64 instead of using non-constant constant.
+
+2021-10-07  Jonathan Wakely  <jwakely@redhat.com>
+
+	* include/bits/erase_if.h (__erase_nodes_if): Remove redundant
+	__niter_base calls.
+	* include/std/string (erase, erase_if): Likewise.
+	* include/std/deque (erase, erase_if): Access non-debug
+	container directly.
+	* include/std/map (erase, erase_if): Likewise.
+	* include/std/set (erase, erase_if): Likewise.
+	* include/std/unordered_map (erase, erase_if): Likewise.
+	* include/std/unordered_set (erase, erase_if): Likewise.
+	* include/std/vector (erase, erase_if): Likewise.
+	* include/experimental/deque (erase, erase_if): Likewise.
+	* include/experimental/map (erase, erase_if): Likewise.
+	* include/experimental/set (erase, erase_if): Likewise.
+	* include/experimental/unordered_map (erase, erase_if):
+	Likewise.
+	* include/experimental/unordered_set (erase, erase_if):
+	Likewise.
+	* include/experimental/vector (erase, erase_if): Likewise.
+
 2021-10-06  Jonathan Wakely  <jwakely@redhat.com>
 
 	* include/Makefile.am: Add new headers.