public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
@ 2021-09-06  8:46 liuhongt
  2021-09-06  8:55 ` Hongtao Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 39+ messages in thread
From: liuhongt @ 2021-09-06  8:46 UTC (permalink / raw)
  To: gcc-patches; +Cc: jakub

Hi:
  As discussed in [1], most of (currently unopposed) targets want
auto-vectorization at O2, and IMHO now would be a good time to enable O2
vectorization for GCC trunk, so it would leave enough time to expose
related issues and fix them.

  Bootstrapped and regtested on x86_64-linux-gnu{-m32,}
  Ok for trunk?

PS:
  Other targets(than x86) may also need to adjust some tests under gcc.target/,
this patch only adjusts gcc.target/i386 and other common tests.

[1] https://gcc.gnu.org/pipermail/gcc/2021-September/237211.html
gcc/ChangeLog:

	* opts.c (default_options_table): Enable auto-vectorization at
	O2 with very-cheap cost model.

gcc/testsuite/ChangeLog:

	* c-c++-common/Wstringop-overflow-2.c: Adjust testcase.
	* g++.dg/tree-ssa/pr81408.C: Ditto.
	* g++.dg/warn/Wuninitialized-13.C: Ditto.
	* gcc.dg/Warray-bounds-51.c: Ditto.
	* gcc.dg/Warray-parameter-3.c: Ditto.
	* gcc.dg/Wstringop-overflow-13.c: Ditto.
	* gcc.dg/Wstringop-overflow-14.c: Ditto.
	* gcc.dg/Wstringop-overflow-21.c: Ditto.
	* gcc.dg/Wstringop-overflow-68.c: Ditto.
	* gcc.dg/gomp/pr46032-2.c: Ditto.
	* gcc.dg/gomp/pr46032-3.c: Ditto.
	* gcc.dg/gomp/simd-2.c: Ditto.
	* gcc.dg/gomp/simd-3.c: Ditto.
	* gcc.dg/graphite/fuse-1.c: Ditto.
	* gcc.dg/pr67089-6.c: Ditto.
	* gcc.dg/pr82929-2.c: Ditto.
	* gcc.dg/pr82929.c: Ditto.
	* gcc.dg/store_merging_1.c: Ditto.
	* gcc.dg/store_merging_11.c: Ditto.
	* gcc.dg/store_merging_15.c: Ditto.
	* gcc.dg/store_merging_16.c: Ditto.
	* gcc.dg/store_merging_19.c: Ditto.
	* gcc.dg/store_merging_24.c: Ditto.
	* gcc.dg/store_merging_25.c: Ditto.
	* gcc.dg/store_merging_28.c: Ditto.
	* gcc.dg/store_merging_30.c: Ditto.
	* gcc.dg/store_merging_5.c: Ditto.
	* gcc.dg/store_merging_7.c: Ditto.
	* gcc.dg/store_merging_8.c: Ditto.
	* gcc.dg/strlenopt-85.c: Ditto.
	* gcc.dg/tree-ssa/dump-6.c: Ditto.
	* gcc.dg/tree-ssa/pr19210-1.c: Ditto.
	* gcc.dg/tree-ssa/pr47059.c: Ditto.
	* gcc.dg/tree-ssa/pr86017.c: Ditto.
	* gcc.dg/tree-ssa/pr91482.c: Ditto.
	* gcc.dg/tree-ssa/predcom-1.c: Ditto.
	* gcc.dg/tree-ssa/predcom-dse-3.c: Ditto.
	* gcc.dg/tree-ssa/prefetch-3.c: Ditto.
	* gcc.dg/tree-ssa/prefetch-6.c: Ditto.
	* gcc.dg/tree-ssa/prefetch-8.c: Ditto.
	* gcc.dg/tree-ssa/prefetch-9.c: Ditto.
	* gcc.dg/tree-ssa/ssa-dse-18.c: Ditto.
	* gcc.dg/tree-ssa/ssa-dse-19.c: Ditto.
	* gcc.dg/uninit-40.c: Ditto.
	* gcc.dg/unroll-7.c: Ditto.
	* gcc.misc-tests/help.exp: Ditto.
	* gcc.target/i386/avx512er-vrcp28ps-4.c: Ditto.
	* gcc.target/i386/avx512er-vrsqrt28ps-4.c: Ditto.
	* gcc.target/i386/avx512er-vrsqrt28ps-6.c: Ditto.
	* gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
	* gcc.target/i386/pr22141.c: Ditto.
	* gcc.target/i386/pr34012.c: Ditto.
	* gcc.target/i386/pr49781-1.c: Ditto.
	* gcc.target/i386/pr52252-atom.c: Ditto.
	* gcc.target/i386/pr52252-core.c: Ditto.
	* gcc.target/i386/pr60451.c: Ditto.
	* gcc.target/i386/pr61403.c: Ditto.
	* gcc.target/i386/pr68483-1.c: Ditto.
	* gcc.target/i386/pr82460-2.c: Ditto.
	* gcc.target/i386/pr95798-1.c: Ditto.
	* gcc.target/i386/pr95798-2.c: Ditto.
	* gcc.target/i386/pr98365.c: Ditto.
	* gcc.target/i386/vect-abs-s16.c: Ditto.
	* gcc.target/i386/vect-abs-s32.c: Ditto.
	* gcc.target/i386/vect-abs-s8.c: Ditto.
	* gcc.target/i386/vect-pack-trunc-1.c: Ditto.
	* gcc.target/i386/vect-pack-trunc-2.c: Ditto.
	* gcc.target/i386/vect-perm-even-1.c: Ditto.
	* gcc.target/i386/vect-perm-odd-1.c: Ditto.
	* gcc.target/i386/vect-pr67800.c: Ditto.
	* gcc.target/i386/vect-unpack-1.c: Ditto.
	* gcc.target/i386/vect-unpack-2.c: Ditto.
	* gcc.target/i386/vect-unpack-3.c: Ditto.
	* gfortran.dg/pr77498.f: Ditto.
---
 gcc/opts.c                                                  | 6 +++---
 gcc/testsuite/c-c++-common/Wstringop-overflow-2.c           | 2 +-
 gcc/testsuite/g++.dg/tree-ssa/pr81408.C                     | 2 +-
 gcc/testsuite/g++.dg/warn/Wuninitialized-13.C               | 2 +-
 gcc/testsuite/gcc.dg/Warray-bounds-51.c                     | 2 +-
 gcc/testsuite/gcc.dg/Warray-parameter-3.c                   | 2 +-
 gcc/testsuite/gcc.dg/Wstringop-overflow-13.c                | 2 +-
 gcc/testsuite/gcc.dg/Wstringop-overflow-14.c                | 2 +-
 gcc/testsuite/gcc.dg/Wstringop-overflow-21.c                | 2 +-
 gcc/testsuite/gcc.dg/Wstringop-overflow-68.c                | 2 +-
 gcc/testsuite/gcc.dg/gomp/pr46032-2.c                       | 2 +-
 gcc/testsuite/gcc.dg/gomp/pr46032-3.c                       | 2 +-
 gcc/testsuite/gcc.dg/gomp/simd-2.c                          | 2 +-
 gcc/testsuite/gcc.dg/gomp/simd-3.c                          | 2 +-
 gcc/testsuite/gcc.dg/graphite/fuse-1.c                      | 2 +-
 gcc/testsuite/gcc.dg/pr67089-6.c                            | 2 +-
 gcc/testsuite/gcc.dg/pr82929-2.c                            | 2 +-
 gcc/testsuite/gcc.dg/pr82929.c                              | 2 +-
 gcc/testsuite/gcc.dg/store_merging_1.c                      | 2 +-
 gcc/testsuite/gcc.dg/store_merging_11.c                     | 2 +-
 gcc/testsuite/gcc.dg/store_merging_15.c                     | 2 +-
 gcc/testsuite/gcc.dg/store_merging_16.c                     | 2 +-
 gcc/testsuite/gcc.dg/store_merging_19.c                     | 2 +-
 gcc/testsuite/gcc.dg/store_merging_24.c                     | 2 +-
 gcc/testsuite/gcc.dg/store_merging_25.c                     | 2 +-
 gcc/testsuite/gcc.dg/store_merging_28.c                     | 2 +-
 gcc/testsuite/gcc.dg/store_merging_30.c                     | 2 +-
 gcc/testsuite/gcc.dg/store_merging_5.c                      | 2 +-
 gcc/testsuite/gcc.dg/store_merging_7.c                      | 2 +-
 gcc/testsuite/gcc.dg/store_merging_8.c                      | 2 +-
 gcc/testsuite/gcc.dg/strlenopt-85.c                         | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/dump-6.c                      | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c                   | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr47059.c                     | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr86017.c                     | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr91482.c                     | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c                   | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c               | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c                  | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c                  | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c                  | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c                  | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c                  | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c                  | 2 +-
 gcc/testsuite/gcc.dg/uninit-40.c                            | 2 +-
 gcc/testsuite/gcc.dg/unroll-7.c                             | 2 +-
 gcc/testsuite/gcc.misc-tests/help.exp                       | 2 +-
 gcc/testsuite/gcc.target/i386/avx512er-vrcp28ps-4.c         | 2 +-
 gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c       | 2 +-
 gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c       | 2 +-
 .../gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c          | 2 +-
 gcc/testsuite/gcc.target/i386/pr22141.c                     | 2 +-
 gcc/testsuite/gcc.target/i386/pr34012.c                     | 2 +-
 gcc/testsuite/gcc.target/i386/pr49781-1.c                   | 2 +-
 gcc/testsuite/gcc.target/i386/pr52252-atom.c                | 2 +-
 gcc/testsuite/gcc.target/i386/pr52252-core.c                | 2 +-
 gcc/testsuite/gcc.target/i386/pr60451.c                     | 2 +-
 gcc/testsuite/gcc.target/i386/pr61403.c                     | 2 +-
 gcc/testsuite/gcc.target/i386/pr68483-1.c                   | 2 +-
 gcc/testsuite/gcc.target/i386/pr82460-2.c                   | 2 +-
 gcc/testsuite/gcc.target/i386/pr95798-1.c                   | 2 +-
 gcc/testsuite/gcc.target/i386/pr95798-2.c                   | 2 +-
 gcc/testsuite/gcc.target/i386/pr98365.c                     | 2 +-
 gcc/testsuite/gcc.target/i386/vect-abs-s16.c                | 2 +-
 gcc/testsuite/gcc.target/i386/vect-abs-s32.c                | 2 +-
 gcc/testsuite/gcc.target/i386/vect-abs-s8.c                 | 2 +-
 gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c           | 2 +-
 gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c           | 2 +-
 gcc/testsuite/gcc.target/i386/vect-perm-even-1.c            | 2 +-
 gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c             | 2 +-
 gcc/testsuite/gcc.target/i386/vect-pr67800.c                | 2 +-
 gcc/testsuite/gcc.target/i386/vect-unpack-1.c               | 2 +-
 gcc/testsuite/gcc.target/i386/vect-unpack-2.c               | 2 +-
 gcc/testsuite/gcc.target/i386/vect-unpack-3.c               | 2 +-
 gcc/testsuite/gfortran.dg/pr77498.f                         | 2 +-
 75 files changed, 77 insertions(+), 77 deletions(-)

diff --git a/gcc/opts.c b/gcc/opts.c
index e0501551ef5..ec6e2a4dc59 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -623,10 +623,12 @@ static const struct default_options default_options_table[] =
     { OPT_LEVELS_2_PLUS, OPT_fstore_merging, NULL, 1 },
     { OPT_LEVELS_2_PLUS, OPT_fthread_jumps, NULL, 1 },
     { OPT_LEVELS_2_PLUS, OPT_ftree_pre, NULL, 1 },
+    { OPT_LEVELS_2_PLUS, OPT_ftree_loop_vectorize, NULL, 1 },
+    { OPT_LEVELS_2_PLUS, OPT_ftree_slp_vectorize, NULL, 1 },
     { 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 },
 
@@ -655,9 +657,7 @@ static const struct default_options default_options_table[] =
     { 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 },
diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
index 1d79930cd58..9351f7e7a1a 100644
--- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
+++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
@@ -1,7 +1,7 @@
 /* PR middle-end/91458 - inconsistent warning for writing past the end
    of an array member
    { dg-do compile }
-   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
+   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
 
 void sink (void*);
 
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
index 39e32fd4bc9..bc14309480c 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 49ee878806a..60e8dd4f0e2 100644
--- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
+++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
@@ -1,6 +1,6 @@
 /* PR c/98597 - ICE in -Wuninitialized printing a MEM_REF
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
 
 struct shared_count {
   shared_count () { }
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-51.c b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
index 6028b11637c..8b81a0ccfa7 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
@@ -1,7 +1,7 @@
 /* PR middle-end/92333 - missing variable name referencing VLA in warnings
    PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
 
 void sink (void*);
 
diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-3.c b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
index cbf3e9339f5..fbef715aa99 100644
--- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
+++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
@@ -59,7 +59,7 @@ void fas1 (int[static 2]);    // { dg-warning "\\\[-Warray-parameter=" }
 
 /* Also verify that -Warray-bounds doesn't trigger for ordinary array
    parameters...  */
-#pragma GCC optimize "2"
+#pragma GCC optimize ("2,-fno-tree-vectorize")
 
 __attribute__ ((noipa)) void
 gca3 (char a[3])
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
index bd513151cea..a78242bf26e 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
@@ -3,7 +3,7 @@
    PR middle-end/89911 - ICE on a call with no arguments to strnlen
    declared with no prototype
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
index d6201b068b6..808bf87c386 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
@@ -2,7 +2,7 @@
    types than char are diagnosed.
    { dg-do compile }
    { dg-require-effective-target int32plus }
-   { dg-options "-O2 -Wall -Wno-array-bounds" } */
+   { dg-options "-O2 -fno-tree-vectorize -Wall -Wno-array-bounds" } */
 
 typedef __INT16_TYPE__  int16_t;
 typedef __INT32_TYPE__  int32_t;
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
index 3a27460220c..f418a17ca93 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
@@ -1,7 +1,7 @@
 /* PR middle-end/92312 - bogus -Wstringop-overflow storing into a trailing
    array backed by larger buffer
    { dg-do compile }
-   { dg-options "-O2 -Wall -Wno-array-bounds" } */
+   { dg-options "-O2 -Wall -Wno-array-bounds -fno-tree-vectorize" } */
 
 struct S0 { char a, b[0]; };
 
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
index 6bcba274541..7cc1012130c 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
@@ -2,7 +2,7 @@
    a larger scalar into a smaller array
    Verify overflow by aggregate stores.
    { dg-do compile }
-   { dg-options "-O2" } */
+   { dg-options "-O2 -fno-tree-vectorize" } */
 
 #define A(N) (A ## N)
 #define Ac1 (AC1){ 0 }
diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
index e110880bd8e..2e562618489 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 a4af7ec4a8a..da1ab487385 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 85acb980f10..f4912127b81 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 86fee858673..c75060c07ae 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 527b6e5c415..61289d312c2 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 db2ffdfeca4..b59d75b2318 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 3442f91af02..b886f1cce76 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 bb84f2b21a3..123e1919cec 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 4cc43dfd9e1..91ca925be0e 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 2ec2394afb9..60ed5cd8bf9 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_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
index acd7de571f8..13fcca4aa11 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 9545dcce3de..cd83f1c0fe5 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 0841bb4deee..0a2bbc4bfde 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 744fe60e8e0..5291bb9e986 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 cf182190e91..96611b5e57b 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 2d6cffc4694..fadb7fff993 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 694d560a621..baf94efe733 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 6e7c72510ff..b0cb0da78e0 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 c744ece6407..dbe000a463e 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 e710a544ff0..d719e0a2257 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 e049e0c30e0..2ba1ee05700 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 70659c00c0e..6c803908781 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 50d86a00485..b9e40e964c1 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 9f9c61aa213..860cde12c0f 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 f216e83c7b3..c7ef73ad59e 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 7d6a724e4ad..0ddad573129 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 f68be2b3379..8c3d9a4fc58 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 ec08d6c0318..1fc8f089345 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 467903bf3fc..46f0d0c2317 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 12f09016943..3fa71685ace 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 cbd6a80d345..00f41c3e4f4 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 da4847320b1..e8848c30acc 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 92b2df80ec8..2e7b5b496ea 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 718b7466e50..7bb8d060631 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 c015191ca32..8708079d397 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 055369bf8b1..695af5757cc 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 5e034d26947..eb6d8686c6a 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=target,optimizers" "" "" ""
 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/avx512er-vrcp28ps-4.c b/gcc/testsuite/gcc.target/i386/avx512er-vrcp28ps-4.c
index 2c76d967184..9f90dfded8b 100644
--- a/gcc/testsuite/gcc.target/i386/avx512er-vrcp28ps-4.c
+++ b/gcc/testsuite/gcc.target/i386/avx512er-vrcp28ps-4.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx512er" } */
+/* { dg-options "-O2 -ffast-math -fvect-cost-model=cheap -mavx512er" } */
 
 #include "avx512er-vrcp28ps-3.c"
 
diff --git a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c
index 2f5f73fd781..ef6cedcc768 100644
--- a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c
+++ b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx512er" } */
+/* { dg-options "-O2 -ffast-math -fvect-cost-model=cheap -mavx512er" } */
 
 #include "avx512er-vrsqrt28ps-3.c"
 
diff --git a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c
index 77c5cba1cef..aa6fd4c62cb 100644
--- a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c
+++ b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx512er" } */
+/* { dg-options "-O2 -ffast-math -fvect-cost-model=cheap -mavx512er" } */
 
 #include "avx512er-vrsqrt28ps-5.c"
 
diff --git a/gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c b/gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c
index 709cd21e671..a732bc466db 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/pr22141.c b/gcc/testsuite/gcc.target/i386/pr22141.c
index 036422e8ccf..b68b97f3f72 100644
--- a/gcc/testsuite/gcc.target/i386/pr22141.c
+++ b/gcc/testsuite/gcc.target/i386/pr22141.c
@@ -1,6 +1,6 @@
 /* PR middle-end/22141 */
 /* { dg-do compile } */
-/* { dg-options "-Os" } */
+/* { dg-options "-Os -fno-tree-vectorize" } */
 
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.target/i386/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
index d0cffa05290..1c1f0eea52e 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 60f9d50d866..d5a2e32db97 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/pr52252-atom.c b/gcc/testsuite/gcc.target/i386/pr52252-atom.c
index ee604f2189a..3761bf3614e 100644
--- a/gcc/testsuite/gcc.target/i386/pr52252-atom.c
+++ b/gcc/testsuite/gcc.target/i386/pr52252-atom.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -mssse3 -mtune=slm" } */
+/* { dg-options "-O2 -fvect-cost-model=cheap -mssse3 -mtune=slm" } */
 #define byte unsigned char
 
 void
diff --git a/gcc/testsuite/gcc.target/i386/pr52252-core.c b/gcc/testsuite/gcc.target/i386/pr52252-core.c
index 65d62cfa365..df0f75c5b1b 100644
--- a/gcc/testsuite/gcc.target/i386/pr52252-core.c
+++ b/gcc/testsuite/gcc.target/i386/pr52252-core.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -mssse3 -mtune=corei7" } */
+/* { dg-options "-O2 -fvect-cost-model=cheap -mssse3 -mtune=corei7" } */
 #define byte unsigned char
 
 void
diff --git a/gcc/testsuite/gcc.target/i386/pr60451.c b/gcc/testsuite/gcc.target/i386/pr60451.c
index 2396ba81da1..c1bca753783 100644
--- a/gcc/testsuite/gcc.target/i386/pr60451.c
+++ b/gcc/testsuite/gcc.target/i386/pr60451.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -msse2" } */
+/* { dg-options "-O2 -fvect-cost-model=cheap -msse2" } */
 
 void
 foo (unsigned char *a, unsigned char *b, unsigned char *c, int size)
diff --git a/gcc/testsuite/gcc.target/i386/pr61403.c b/gcc/testsuite/gcc.target/i386/pr61403.c
index 48c7ba68d78..b9165a4ed81 100644
--- a/gcc/testsuite/gcc.target/i386/pr61403.c
+++ b/gcc/testsuite/gcc.target/i386/pr61403.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse4.2 -mtune=corei7" } */
+/* { dg-options "-O2 -ffast-math -fvect-cost-model=cheap -msse4.2 -mtune=corei7" } */
 /* { dg-require-effective-target c99_runtime } */
 
 #include <math.h>
diff --git a/gcc/testsuite/gcc.target/i386/pr68483-1.c b/gcc/testsuite/gcc.target/i386/pr68483-1.c
index 29787e94bd3..493d6a9011a 100644
--- a/gcc/testsuite/gcc.target/i386/pr68483-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr68483-1.c
@@ -1,6 +1,6 @@
 /* PR target/68483 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse3" } */
+/* { dg-options "-O2 -fvect-cost-model=cheap -msse2 -mno-sse3" } */
 
 void
 test (int *input, int *out, unsigned x1, unsigned x2)
diff --git a/gcc/testsuite/gcc.target/i386/pr82460-2.c b/gcc/testsuite/gcc.target/i386/pr82460-2.c
index 8cdfb54f56a..72076d490e2 100644
--- a/gcc/testsuite/gcc.target/i386/pr82460-2.c
+++ b/gcc/testsuite/gcc.target/i386/pr82460-2.c
@@ -1,6 +1,6 @@
 /* PR target/82460 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -mavx512vbmi -mprefer-vector-width=none --param=vect-epilogues-nomask=0" } */
+/* { dg-options "-O2 -fvect-cost-model=cheap -mavx512vbmi -mprefer-vector-width=none --param=vect-epilogues-nomask=0" } */
 /* We want to reuse the permutation mask in the loop, so use vpermt2b rather
    than vpermi2b.  */
 /* { dg-final { scan-assembler-not {\mvpermi2b\M} } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr95798-1.c b/gcc/testsuite/gcc.target/i386/pr95798-1.c
index 9a7e32d6f2f..526f48921fd 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 c670d3780e8..6b5c5a73e96 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/gcc.target/i386/pr98365.c b/gcc/testsuite/gcc.target/i386/pr98365.c
index 652210dcdd5..6bb58d08fe5 100644
--- a/gcc/testsuite/gcc.target/i386/pr98365.c
+++ b/gcc/testsuite/gcc.target/i386/pr98365.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mavx2 -ftree-vectorize -fdump-tree-vect-details" } */
+/* { dg-options "-O2 -mavx2 -fvect-cost-model=cheap -fdump-tree-vect-details" } */
 /* { dg-final { scan-tree-dump-times "vectorized \[1-3] loops" 2 "vect" } } */
 short foo1 (short* a, short* c, int n)
 {
diff --git a/gcc/testsuite/gcc.target/i386/vect-abs-s16.c b/gcc/testsuite/gcc.target/i386/vect-abs-s16.c
index 266599f8ea2..b4c54129c39 100644
--- a/gcc/testsuite/gcc.target/i386/vect-abs-s16.c
+++ b/gcc/testsuite/gcc.target/i386/vect-abs-s16.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse3 -fdump-tree-vect-details" } */
+/* { dg-options "-O2 -fvect-cost-model=cheap -msse2 -mno-sse3 -fdump-tree-vect-details" } */
 
 int abs (int);
 
diff --git a/gcc/testsuite/gcc.target/i386/vect-abs-s32.c b/gcc/testsuite/gcc.target/i386/vect-abs-s32.c
index 0a6bdac60f7..f14380556c4 100644
--- a/gcc/testsuite/gcc.target/i386/vect-abs-s32.c
+++ b/gcc/testsuite/gcc.target/i386/vect-abs-s32.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse3 -fdump-tree-vect-details" } */
+/* { dg-options "-O2 -fvect-cost-model=cheap -msse2 -mno-sse3 -fdump-tree-vect-details" } */
 
 int abs (int);
 
diff --git a/gcc/testsuite/gcc.target/i386/vect-abs-s8.c b/gcc/testsuite/gcc.target/i386/vect-abs-s8.c
index d6e31976f40..7a965a0295a 100644
--- a/gcc/testsuite/gcc.target/i386/vect-abs-s8.c
+++ b/gcc/testsuite/gcc.target/i386/vect-abs-s8.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse3 -fdump-tree-vect-details" } */
+/* { dg-options "-O2 -fvect-cost-model=cheap -msse2 -mno-sse3 -fdump-tree-vect-details" } */
 
 int abs (int);
 
diff --git a/gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c b/gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c
index 1b468e47754..08c30a35e70 100644
--- a/gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c
+++ b/gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
+/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
 /* { dg-require-effective-target avx512bw } */
 
 #include "avx512bw-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c b/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c
index 3503deaa9d9..ebb6f5c578e 100644
--- a/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c
+++ b/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
+/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
 /* { dg-require-effective-target avx512bw } */
 
 #include "avx512bw-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c b/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c
index 3de4dfabeea..e8507f49b1d 100644
--- a/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c
+++ b/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
+/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
 /* { dg-require-effective-target avx512bw } */
 
 #include "avx512bw-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c b/gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c
index e32d40a1bac..37514f4737e 100644
--- a/gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c
+++ b/gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
+/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
 /* { dg-require-effective-target avx512bw } */
 
 #include "avx512bw-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/vect-pr67800.c b/gcc/testsuite/gcc.target/i386/vect-pr67800.c
index 8bd308c83f6..31cd7970206 100644
--- a/gcc/testsuite/gcc.target/i386/vect-pr67800.c
+++ b/gcc/testsuite/gcc.target/i386/vect-pr67800.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -msse4.2" } */
+/* { dg-options "-O2 -fvect-cost-model=cheap -fdump-tree-vect-details -msse4.2" } */
 
 #define ubyte unsigned char
 #define byte char
diff --git a/gcc/testsuite/gcc.target/i386/vect-unpack-1.c b/gcc/testsuite/gcc.target/i386/vect-unpack-1.c
index 84521e313e5..f572e4c8085 100644
--- a/gcc/testsuite/gcc.target/i386/vect-unpack-1.c
+++ b/gcc/testsuite/gcc.target/i386/vect-unpack-1.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
+/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
 /* { dg-require-effective-target avx512bw } */
 
 #include "avx512bw-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/vect-unpack-2.c b/gcc/testsuite/gcc.target/i386/vect-unpack-2.c
index 51c518e6111..7234afddd4c 100644
--- a/gcc/testsuite/gcc.target/i386/vect-unpack-2.c
+++ b/gcc/testsuite/gcc.target/i386/vect-unpack-2.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
+/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
 /* { dg-require-effective-target avx512bw } */
 
 #include "avx512bw-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/vect-unpack-3.c b/gcc/testsuite/gcc.target/i386/vect-unpack-3.c
index eb8a93e9eea..08e9827afcc 100644
--- a/gcc/testsuite/gcc.target/i386/vect-unpack-3.c
+++ b/gcc/testsuite/gcc.target/i386/vect-unpack-3.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -fdump-tree-vect-details -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
+/* { dg-options "-O2 -fdump-tree-vect-details -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
 /* { dg-require-effective-target avx512bw } */
 
 #include "avx512bw-check.h"
diff --git a/gcc/testsuite/gfortran.dg/pr77498.f b/gcc/testsuite/gfortran.dg/pr77498.f
index f957b57bb00..a0fc8275a84 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
-- 
2.27.0


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-06  8:46 [PATCH] Enable auto-vectorization at O2 with very-cheap cost model liuhongt
@ 2021-09-06  8:55 ` Hongtao Liu
  2021-09-06  9:18 ` Richard Biener
  2021-09-06 16:37 ` Joseph Myers
  2 siblings, 0 replies; 39+ messages in thread
From: Hongtao Liu @ 2021-09-06  8:55 UTC (permalink / raw)
  To: liuhongt
  Cc: GCC Patches, Jakub Jelinek, Richard Biener, Richard Sandiford,
	Tamar Christina, Jeff Law, Segher Boessenkool, Kewen.Lin,
	Premachandra.Mallappa, Florian Weimer, Bill Schmidt

On Mon, Sep 6, 2021 at 4:46 PM liuhongt via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Hi:
>   As discussed in [1], most of (currently unopposed) targets want
> auto-vectorization at O2, and IMHO now would be a good time to enable O2
> vectorization for GCC trunk, so it would leave enough time to expose
> related issues and fix them.
>
>   Bootstrapped and regtested on x86_64-linux-gnu{-m32,}
>   Ok for trunk?
>
> PS:
>   Other targets(than x86) may also need to adjust some tests under gcc.target/,
> this patch only adjusts gcc.target/i386 and other common tests.
>
> [1] https://gcc.gnu.org/pipermail/gcc/2021-September/237211.html
> gcc/ChangeLog:
>
>         * opts.c (default_options_table): Enable auto-vectorization at
>         O2 with very-cheap cost model.
>
> gcc/testsuite/ChangeLog:
>
>         * c-c++-common/Wstringop-overflow-2.c: Adjust testcase.
>         * g++.dg/tree-ssa/pr81408.C: Ditto.
>         * g++.dg/warn/Wuninitialized-13.C: Ditto.
>         * gcc.dg/Warray-bounds-51.c: Ditto.
>         * gcc.dg/Warray-parameter-3.c: Ditto.
>         * gcc.dg/Wstringop-overflow-13.c: Ditto.
>         * gcc.dg/Wstringop-overflow-14.c: Ditto.
>         * gcc.dg/Wstringop-overflow-21.c: Ditto.
>         * gcc.dg/Wstringop-overflow-68.c: Ditto.
>         * gcc.dg/gomp/pr46032-2.c: Ditto.
>         * gcc.dg/gomp/pr46032-3.c: Ditto.
>         * gcc.dg/gomp/simd-2.c: Ditto.
>         * gcc.dg/gomp/simd-3.c: Ditto.
>         * gcc.dg/graphite/fuse-1.c: Ditto.
>         * gcc.dg/pr67089-6.c: Ditto.
>         * gcc.dg/pr82929-2.c: Ditto.
>         * gcc.dg/pr82929.c: Ditto.
>         * gcc.dg/store_merging_1.c: Ditto.
>         * gcc.dg/store_merging_11.c: Ditto.
>         * gcc.dg/store_merging_15.c: Ditto.
>         * gcc.dg/store_merging_16.c: Ditto.
>         * gcc.dg/store_merging_19.c: Ditto.
>         * gcc.dg/store_merging_24.c: Ditto.
>         * gcc.dg/store_merging_25.c: Ditto.
>         * gcc.dg/store_merging_28.c: Ditto.
>         * gcc.dg/store_merging_30.c: Ditto.
>         * gcc.dg/store_merging_5.c: Ditto.
>         * gcc.dg/store_merging_7.c: Ditto.
>         * gcc.dg/store_merging_8.c: Ditto.
>         * gcc.dg/strlenopt-85.c: Ditto.
>         * gcc.dg/tree-ssa/dump-6.c: Ditto.
>         * gcc.dg/tree-ssa/pr19210-1.c: Ditto.
>         * gcc.dg/tree-ssa/pr47059.c: Ditto.
>         * gcc.dg/tree-ssa/pr86017.c: Ditto.
>         * gcc.dg/tree-ssa/pr91482.c: Ditto.
>         * gcc.dg/tree-ssa/predcom-1.c: Ditto.
>         * gcc.dg/tree-ssa/predcom-dse-3.c: Ditto.
>         * gcc.dg/tree-ssa/prefetch-3.c: Ditto.
>         * gcc.dg/tree-ssa/prefetch-6.c: Ditto.
>         * gcc.dg/tree-ssa/prefetch-8.c: Ditto.
>         * gcc.dg/tree-ssa/prefetch-9.c: Ditto.
>         * gcc.dg/tree-ssa/ssa-dse-18.c: Ditto.
>         * gcc.dg/tree-ssa/ssa-dse-19.c: Ditto.
>         * gcc.dg/uninit-40.c: Ditto.
>         * gcc.dg/unroll-7.c: Ditto.
>         * gcc.misc-tests/help.exp: Ditto.
>         * gcc.target/i386/avx512er-vrcp28ps-4.c: Ditto.
>         * gcc.target/i386/avx512er-vrsqrt28ps-4.c: Ditto.
>         * gcc.target/i386/avx512er-vrsqrt28ps-6.c: Ditto.
>         * gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
>         * gcc.target/i386/pr22141.c: Ditto.
>         * gcc.target/i386/pr34012.c: Ditto.
>         * gcc.target/i386/pr49781-1.c: Ditto.
>         * gcc.target/i386/pr52252-atom.c: Ditto.
>         * gcc.target/i386/pr52252-core.c: Ditto.
>         * gcc.target/i386/pr60451.c: Ditto.
>         * gcc.target/i386/pr61403.c: Ditto.
>         * gcc.target/i386/pr68483-1.c: Ditto.
>         * gcc.target/i386/pr82460-2.c: Ditto.
>         * gcc.target/i386/pr95798-1.c: Ditto.
>         * gcc.target/i386/pr95798-2.c: Ditto.
>         * gcc.target/i386/pr98365.c: Ditto.
>         * gcc.target/i386/vect-abs-s16.c: Ditto.
>         * gcc.target/i386/vect-abs-s32.c: Ditto.
>         * gcc.target/i386/vect-abs-s8.c: Ditto.
>         * gcc.target/i386/vect-pack-trunc-1.c: Ditto.
>         * gcc.target/i386/vect-pack-trunc-2.c: Ditto.
>         * gcc.target/i386/vect-perm-even-1.c: Ditto.
>         * gcc.target/i386/vect-perm-odd-1.c: Ditto.
>         * gcc.target/i386/vect-pr67800.c: Ditto.
>         * gcc.target/i386/vect-unpack-1.c: Ditto.
>         * gcc.target/i386/vect-unpack-2.c: Ditto.
>         * gcc.target/i386/vect-unpack-3.c: Ditto.
>         * gfortran.dg/pr77498.f: Ditto.
> ---
>  gcc/opts.c                                                  | 6 +++---
>  gcc/testsuite/c-c++-common/Wstringop-overflow-2.c           | 2 +-
>  gcc/testsuite/g++.dg/tree-ssa/pr81408.C                     | 2 +-
>  gcc/testsuite/g++.dg/warn/Wuninitialized-13.C               | 2 +-
>  gcc/testsuite/gcc.dg/Warray-bounds-51.c                     | 2 +-
>  gcc/testsuite/gcc.dg/Warray-parameter-3.c                   | 2 +-
>  gcc/testsuite/gcc.dg/Wstringop-overflow-13.c                | 2 +-
>  gcc/testsuite/gcc.dg/Wstringop-overflow-14.c                | 2 +-
>  gcc/testsuite/gcc.dg/Wstringop-overflow-21.c                | 2 +-
>  gcc/testsuite/gcc.dg/Wstringop-overflow-68.c                | 2 +-
>  gcc/testsuite/gcc.dg/gomp/pr46032-2.c                       | 2 +-
>  gcc/testsuite/gcc.dg/gomp/pr46032-3.c                       | 2 +-
>  gcc/testsuite/gcc.dg/gomp/simd-2.c                          | 2 +-
>  gcc/testsuite/gcc.dg/gomp/simd-3.c                          | 2 +-
>  gcc/testsuite/gcc.dg/graphite/fuse-1.c                      | 2 +-
>  gcc/testsuite/gcc.dg/pr67089-6.c                            | 2 +-
>  gcc/testsuite/gcc.dg/pr82929-2.c                            | 2 +-
>  gcc/testsuite/gcc.dg/pr82929.c                              | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_1.c                      | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_11.c                     | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_15.c                     | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_16.c                     | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_19.c                     | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_24.c                     | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_25.c                     | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_28.c                     | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_30.c                     | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_5.c                      | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_7.c                      | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_8.c                      | 2 +-
>  gcc/testsuite/gcc.dg/strlenopt-85.c                         | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/dump-6.c                      | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c                   | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/pr47059.c                     | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/pr86017.c                     | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/pr91482.c                     | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c                   | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c               | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c                  | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c                  | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c                  | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c                  | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c                  | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c                  | 2 +-
>  gcc/testsuite/gcc.dg/uninit-40.c                            | 2 +-
>  gcc/testsuite/gcc.dg/unroll-7.c                             | 2 +-
>  gcc/testsuite/gcc.misc-tests/help.exp                       | 2 +-
>  gcc/testsuite/gcc.target/i386/avx512er-vrcp28ps-4.c         | 2 +-
>  gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c       | 2 +-
>  gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c       | 2 +-
>  .../gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c          | 2 +-
>  gcc/testsuite/gcc.target/i386/pr22141.c                     | 2 +-
>  gcc/testsuite/gcc.target/i386/pr34012.c                     | 2 +-
>  gcc/testsuite/gcc.target/i386/pr49781-1.c                   | 2 +-
>  gcc/testsuite/gcc.target/i386/pr52252-atom.c                | 2 +-
>  gcc/testsuite/gcc.target/i386/pr52252-core.c                | 2 +-
>  gcc/testsuite/gcc.target/i386/pr60451.c                     | 2 +-
>  gcc/testsuite/gcc.target/i386/pr61403.c                     | 2 +-
>  gcc/testsuite/gcc.target/i386/pr68483-1.c                   | 2 +-
>  gcc/testsuite/gcc.target/i386/pr82460-2.c                   | 2 +-
>  gcc/testsuite/gcc.target/i386/pr95798-1.c                   | 2 +-
>  gcc/testsuite/gcc.target/i386/pr95798-2.c                   | 2 +-
>  gcc/testsuite/gcc.target/i386/pr98365.c                     | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-abs-s16.c                | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-abs-s32.c                | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-abs-s8.c                 | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c           | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c           | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-perm-even-1.c            | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c             | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-pr67800.c                | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-unpack-1.c               | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-unpack-2.c               | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-unpack-3.c               | 2 +-
>  gcc/testsuite/gfortran.dg/pr77498.f                         | 2 +-
>  75 files changed, 77 insertions(+), 77 deletions(-)
>
> diff --git a/gcc/opts.c b/gcc/opts.c
> index e0501551ef5..ec6e2a4dc59 100644
> --- a/gcc/opts.c
> +++ b/gcc/opts.c
> @@ -623,10 +623,12 @@ static const struct default_options default_options_table[] =
>      { OPT_LEVELS_2_PLUS, OPT_fstore_merging, NULL, 1 },
>      { OPT_LEVELS_2_PLUS, OPT_fthread_jumps, NULL, 1 },
>      { OPT_LEVELS_2_PLUS, OPT_ftree_pre, NULL, 1 },
> +    { OPT_LEVELS_2_PLUS, OPT_ftree_loop_vectorize, NULL, 1 },
> +    { OPT_LEVELS_2_PLUS, OPT_ftree_slp_vectorize, NULL, 1 },
>      { 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 },
>
> @@ -655,9 +657,7 @@ static const struct default_options default_options_table[] =
>      { 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 },
> diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> index 1d79930cd58..9351f7e7a1a 100644
> --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> @@ -1,7 +1,7 @@
>  /* PR middle-end/91458 - inconsistent warning for writing past the end
>     of an array member
>     { dg-do compile }
> -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
>
>  void sink (void*);
>
> diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
> index 39e32fd4bc9..bc14309480c 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 49ee878806a..60e8dd4f0e2 100644
> --- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> +++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> @@ -1,6 +1,6 @@
>  /* PR c/98597 - ICE in -Wuninitialized printing a MEM_REF
>     { dg-do compile }
> -   { dg-options "-O2 -Wall" } */
> +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
>
>  struct shared_count {
>    shared_count () { }
> diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-51.c b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> index 6028b11637c..8b81a0ccfa7 100644
> --- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> +++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> @@ -1,7 +1,7 @@
>  /* PR middle-end/92333 - missing variable name referencing VLA in warnings
>     PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
>     { dg-do compile }
> -   { dg-options "-O2 -Wall" } */
> +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
>
>  void sink (void*);
>
> diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-3.c b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> index cbf3e9339f5..fbef715aa99 100644
> --- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> +++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> @@ -59,7 +59,7 @@ void fas1 (int[static 2]);    // { dg-warning "\\\[-Warray-parameter=" }
>
>  /* Also verify that -Warray-bounds doesn't trigger for ordinary array
>     parameters...  */
> -#pragma GCC optimize "2"
> +#pragma GCC optimize ("2,-fno-tree-vectorize")
>
>  __attribute__ ((noipa)) void
>  gca3 (char a[3])
> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> index bd513151cea..a78242bf26e 100644
> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> @@ -3,7 +3,7 @@
>     PR middle-end/89911 - ICE on a call with no arguments to strnlen
>     declared with no prototype
>     { dg-do compile }
> -   { dg-options "-O2 -Wall" } */
> +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
>
>  typedef __SIZE_TYPE__ size_t;
>
> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> index d6201b068b6..808bf87c386 100644
> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> @@ -2,7 +2,7 @@
>     types than char are diagnosed.
>     { dg-do compile }
>     { dg-require-effective-target int32plus }
> -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> +   { dg-options "-O2 -fno-tree-vectorize -Wall -Wno-array-bounds" } */
>
>  typedef __INT16_TYPE__  int16_t;
>  typedef __INT32_TYPE__  int32_t;
> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> index 3a27460220c..f418a17ca93 100644
> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> @@ -1,7 +1,7 @@
>  /* PR middle-end/92312 - bogus -Wstringop-overflow storing into a trailing
>     array backed by larger buffer
>     { dg-do compile }
> -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-tree-vectorize" } */
>
>  struct S0 { char a, b[0]; };
>
> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> index 6bcba274541..7cc1012130c 100644
> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> @@ -2,7 +2,7 @@
>     a larger scalar into a smaller array
>     Verify overflow by aggregate stores.
>     { dg-do compile }
> -   { dg-options "-O2" } */
> +   { dg-options "-O2 -fno-tree-vectorize" } */
>
>  #define A(N) (A ## N)
>  #define Ac1 (AC1){ 0 }
> diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
> index e110880bd8e..2e562618489 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 a4af7ec4a8a..da1ab487385 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 85acb980f10..f4912127b81 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 86fee858673..c75060c07ae 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 527b6e5c415..61289d312c2 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 db2ffdfeca4..b59d75b2318 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 3442f91af02..b886f1cce76 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 bb84f2b21a3..123e1919cec 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 4cc43dfd9e1..91ca925be0e 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 2ec2394afb9..60ed5cd8bf9 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_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
> index acd7de571f8..13fcca4aa11 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 9545dcce3de..cd83f1c0fe5 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 0841bb4deee..0a2bbc4bfde 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 744fe60e8e0..5291bb9e986 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 cf182190e91..96611b5e57b 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 2d6cffc4694..fadb7fff993 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 694d560a621..baf94efe733 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 6e7c72510ff..b0cb0da78e0 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 c744ece6407..dbe000a463e 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 e710a544ff0..d719e0a2257 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 e049e0c30e0..2ba1ee05700 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 70659c00c0e..6c803908781 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 50d86a00485..b9e40e964c1 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 9f9c61aa213..860cde12c0f 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 f216e83c7b3..c7ef73ad59e 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 7d6a724e4ad..0ddad573129 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 f68be2b3379..8c3d9a4fc58 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 ec08d6c0318..1fc8f089345 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 467903bf3fc..46f0d0c2317 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 12f09016943..3fa71685ace 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 cbd6a80d345..00f41c3e4f4 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 da4847320b1..e8848c30acc 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 92b2df80ec8..2e7b5b496ea 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 718b7466e50..7bb8d060631 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 c015191ca32..8708079d397 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 055369bf8b1..695af5757cc 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 5e034d26947..eb6d8686c6a 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=target,optimizers" "" "" ""
>  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/avx512er-vrcp28ps-4.c b/gcc/testsuite/gcc.target/i386/avx512er-vrcp28ps-4.c
> index 2c76d967184..9f90dfded8b 100644
> --- a/gcc/testsuite/gcc.target/i386/avx512er-vrcp28ps-4.c
> +++ b/gcc/testsuite/gcc.target/i386/avx512er-vrcp28ps-4.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx512er" } */
> +/* { dg-options "-O2 -ffast-math -fvect-cost-model=cheap -mavx512er" } */
>
>  #include "avx512er-vrcp28ps-3.c"
>
> diff --git a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c
> index 2f5f73fd781..ef6cedcc768 100644
> --- a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c
> +++ b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx512er" } */
> +/* { dg-options "-O2 -ffast-math -fvect-cost-model=cheap -mavx512er" } */
>
>  #include "avx512er-vrsqrt28ps-3.c"
>
> diff --git a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c
> index 77c5cba1cef..aa6fd4c62cb 100644
> --- a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c
> +++ b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx512er" } */
> +/* { dg-options "-O2 -ffast-math -fvect-cost-model=cheap -mavx512er" } */
>
>  #include "avx512er-vrsqrt28ps-5.c"
>
> diff --git a/gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c b/gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c
> index 709cd21e671..a732bc466db 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/pr22141.c b/gcc/testsuite/gcc.target/i386/pr22141.c
> index 036422e8ccf..b68b97f3f72 100644
> --- a/gcc/testsuite/gcc.target/i386/pr22141.c
> +++ b/gcc/testsuite/gcc.target/i386/pr22141.c
> @@ -1,6 +1,6 @@
>  /* PR middle-end/22141 */
>  /* { dg-do compile } */
> -/* { dg-options "-Os" } */
> +/* { dg-options "-Os -fno-tree-vectorize" } */
>
>  extern void abort (void);
>
> diff --git a/gcc/testsuite/gcc.target/i386/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
> index d0cffa05290..1c1f0eea52e 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 60f9d50d866..d5a2e32db97 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/pr52252-atom.c b/gcc/testsuite/gcc.target/i386/pr52252-atom.c
> index ee604f2189a..3761bf3614e 100644
> --- a/gcc/testsuite/gcc.target/i386/pr52252-atom.c
> +++ b/gcc/testsuite/gcc.target/i386/pr52252-atom.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -mssse3 -mtune=slm" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -mssse3 -mtune=slm" } */
>  #define byte unsigned char
>
>  void
> diff --git a/gcc/testsuite/gcc.target/i386/pr52252-core.c b/gcc/testsuite/gcc.target/i386/pr52252-core.c
> index 65d62cfa365..df0f75c5b1b 100644
> --- a/gcc/testsuite/gcc.target/i386/pr52252-core.c
> +++ b/gcc/testsuite/gcc.target/i386/pr52252-core.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -mssse3 -mtune=corei7" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -mssse3 -mtune=corei7" } */
>  #define byte unsigned char
>
>  void
> diff --git a/gcc/testsuite/gcc.target/i386/pr60451.c b/gcc/testsuite/gcc.target/i386/pr60451.c
> index 2396ba81da1..c1bca753783 100644
> --- a/gcc/testsuite/gcc.target/i386/pr60451.c
> +++ b/gcc/testsuite/gcc.target/i386/pr60451.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -msse2" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -msse2" } */
>
>  void
>  foo (unsigned char *a, unsigned char *b, unsigned char *c, int size)
> diff --git a/gcc/testsuite/gcc.target/i386/pr61403.c b/gcc/testsuite/gcc.target/i386/pr61403.c
> index 48c7ba68d78..b9165a4ed81 100644
> --- a/gcc/testsuite/gcc.target/i386/pr61403.c
> +++ b/gcc/testsuite/gcc.target/i386/pr61403.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse4.2 -mtune=corei7" } */
> +/* { dg-options "-O2 -ffast-math -fvect-cost-model=cheap -msse4.2 -mtune=corei7" } */
>  /* { dg-require-effective-target c99_runtime } */
>
>  #include <math.h>
> diff --git a/gcc/testsuite/gcc.target/i386/pr68483-1.c b/gcc/testsuite/gcc.target/i386/pr68483-1.c
> index 29787e94bd3..493d6a9011a 100644
> --- a/gcc/testsuite/gcc.target/i386/pr68483-1.c
> +++ b/gcc/testsuite/gcc.target/i386/pr68483-1.c
> @@ -1,6 +1,6 @@
>  /* PR target/68483 */
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse3" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -msse2 -mno-sse3" } */
>
>  void
>  test (int *input, int *out, unsigned x1, unsigned x2)
> diff --git a/gcc/testsuite/gcc.target/i386/pr82460-2.c b/gcc/testsuite/gcc.target/i386/pr82460-2.c
> index 8cdfb54f56a..72076d490e2 100644
> --- a/gcc/testsuite/gcc.target/i386/pr82460-2.c
> +++ b/gcc/testsuite/gcc.target/i386/pr82460-2.c
> @@ -1,6 +1,6 @@
>  /* PR target/82460 */
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -mavx512vbmi -mprefer-vector-width=none --param=vect-epilogues-nomask=0" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -mavx512vbmi -mprefer-vector-width=none --param=vect-epilogues-nomask=0" } */
>  /* We want to reuse the permutation mask in the loop, so use vpermt2b rather
>     than vpermi2b.  */
>  /* { dg-final { scan-assembler-not {\mvpermi2b\M} } } */
> diff --git a/gcc/testsuite/gcc.target/i386/pr95798-1.c b/gcc/testsuite/gcc.target/i386/pr95798-1.c
> index 9a7e32d6f2f..526f48921fd 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 c670d3780e8..6b5c5a73e96 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/gcc.target/i386/pr98365.c b/gcc/testsuite/gcc.target/i386/pr98365.c
> index 652210dcdd5..6bb58d08fe5 100644
> --- a/gcc/testsuite/gcc.target/i386/pr98365.c
> +++ b/gcc/testsuite/gcc.target/i386/pr98365.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -mavx2 -ftree-vectorize -fdump-tree-vect-details" } */
> +/* { dg-options "-O2 -mavx2 -fvect-cost-model=cheap -fdump-tree-vect-details" } */
>  /* { dg-final { scan-tree-dump-times "vectorized \[1-3] loops" 2 "vect" } } */
>  short foo1 (short* a, short* c, int n)
>  {
> diff --git a/gcc/testsuite/gcc.target/i386/vect-abs-s16.c b/gcc/testsuite/gcc.target/i386/vect-abs-s16.c
> index 266599f8ea2..b4c54129c39 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-abs-s16.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-abs-s16.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse3 -fdump-tree-vect-details" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -msse2 -mno-sse3 -fdump-tree-vect-details" } */
>
>  int abs (int);
>
> diff --git a/gcc/testsuite/gcc.target/i386/vect-abs-s32.c b/gcc/testsuite/gcc.target/i386/vect-abs-s32.c
> index 0a6bdac60f7..f14380556c4 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-abs-s32.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-abs-s32.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse3 -fdump-tree-vect-details" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -msse2 -mno-sse3 -fdump-tree-vect-details" } */
>
>  int abs (int);
>
> diff --git a/gcc/testsuite/gcc.target/i386/vect-abs-s8.c b/gcc/testsuite/gcc.target/i386/vect-abs-s8.c
> index d6e31976f40..7a965a0295a 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-abs-s8.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-abs-s8.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse3 -fdump-tree-vect-details" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -msse2 -mno-sse3 -fdump-tree-vect-details" } */
>
>  int abs (int);
>
> diff --git a/gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c b/gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c
> index 1b468e47754..08c30a35e70 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c
> @@ -1,5 +1,5 @@
>  /* { dg-do run } */
> -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
>  /* { dg-require-effective-target avx512bw } */
>
>  #include "avx512bw-check.h"
> diff --git a/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c b/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c
> index 3503deaa9d9..ebb6f5c578e 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c
> @@ -1,5 +1,5 @@
>  /* { dg-do run } */
> -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
>  /* { dg-require-effective-target avx512bw } */
>
>  #include "avx512bw-check.h"
> diff --git a/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c b/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c
> index 3de4dfabeea..e8507f49b1d 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c
> @@ -1,5 +1,5 @@
>  /* { dg-do run } */
> -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
>  /* { dg-require-effective-target avx512bw } */
>
>  #include "avx512bw-check.h"
> diff --git a/gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c b/gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c
> index e32d40a1bac..37514f4737e 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c
> @@ -1,5 +1,5 @@
>  /* { dg-do run } */
> -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
>  /* { dg-require-effective-target avx512bw } */
>
>  #include "avx512bw-check.h"
> diff --git a/gcc/testsuite/gcc.target/i386/vect-pr67800.c b/gcc/testsuite/gcc.target/i386/vect-pr67800.c
> index 8bd308c83f6..31cd7970206 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-pr67800.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-pr67800.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -msse4.2" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -fdump-tree-vect-details -msse4.2" } */
>
>  #define ubyte unsigned char
>  #define byte char
> diff --git a/gcc/testsuite/gcc.target/i386/vect-unpack-1.c b/gcc/testsuite/gcc.target/i386/vect-unpack-1.c
> index 84521e313e5..f572e4c8085 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-unpack-1.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-unpack-1.c
> @@ -1,5 +1,5 @@
>  /* { dg-do run } */
> -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
>  /* { dg-require-effective-target avx512bw } */
>
>  #include "avx512bw-check.h"
> diff --git a/gcc/testsuite/gcc.target/i386/vect-unpack-2.c b/gcc/testsuite/gcc.target/i386/vect-unpack-2.c
> index 51c518e6111..7234afddd4c 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-unpack-2.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-unpack-2.c
> @@ -1,5 +1,5 @@
>  /* { dg-do run } */
> -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
>  /* { dg-require-effective-target avx512bw } */
>
>  #include "avx512bw-check.h"
> diff --git a/gcc/testsuite/gcc.target/i386/vect-unpack-3.c b/gcc/testsuite/gcc.target/i386/vect-unpack-3.c
> index eb8a93e9eea..08e9827afcc 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-unpack-3.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-unpack-3.c
> @@ -1,5 +1,5 @@
>  /* { dg-do run } */
> -/* { dg-options "-O2 -fdump-tree-vect-details -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> +/* { dg-options "-O2 -fdump-tree-vect-details -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
>  /* { dg-require-effective-target avx512bw } */
>
>  #include "avx512bw-check.h"
> diff --git a/gcc/testsuite/gfortran.dg/pr77498.f b/gcc/testsuite/gfortran.dg/pr77498.f
> index f957b57bb00..a0fc8275a84 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
> --
> 2.27.0
>


--
BR,
Hongtao

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-06  8:46 [PATCH] Enable auto-vectorization at O2 with very-cheap cost model liuhongt
  2021-09-06  8:55 ` Hongtao Liu
@ 2021-09-06  9:18 ` Richard Biener
  2021-09-06  9:41   ` Jakub Jelinek
  2021-09-06  9:41   ` Hongtao Liu
  2021-09-06 16:37 ` Joseph Myers
  2 siblings, 2 replies; 39+ messages in thread
From: Richard Biener @ 2021-09-06  9:18 UTC (permalink / raw)
  To: liuhongt; +Cc: GCC Patches, Jakub Jelinek

On Mon, Sep 6, 2021 at 10:47 AM liuhongt via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Hi:
>   As discussed in [1], most of (currently unopposed) targets want
> auto-vectorization at O2, and IMHO now would be a good time to enable O2
> vectorization for GCC trunk, so it would leave enough time to expose
> related issues and fix them.
>
>   Bootstrapped and regtested on x86_64-linux-gnu{-m32,}
>   Ok for trunk?

It changes the cost model used when the user specifices
-O2 -ftree-vectorize which used 'cheap' before but now sticks to
'very-cheap'.  I guess adjusting the cost model in process_options
might be possible when any(?) of the vectorizer flags were set
explicitly?

Richard.

> PS:
>   Other targets(than x86) may also need to adjust some tests under gcc.target/,
> this patch only adjusts gcc.target/i386 and other common tests.
>
> [1] https://gcc.gnu.org/pipermail/gcc/2021-September/237211.html
> gcc/ChangeLog:
>
>         * opts.c (default_options_table): Enable auto-vectorization at
>         O2 with very-cheap cost model.
>
> gcc/testsuite/ChangeLog:
>
>         * c-c++-common/Wstringop-overflow-2.c: Adjust testcase.
>         * g++.dg/tree-ssa/pr81408.C: Ditto.
>         * g++.dg/warn/Wuninitialized-13.C: Ditto.
>         * gcc.dg/Warray-bounds-51.c: Ditto.
>         * gcc.dg/Warray-parameter-3.c: Ditto.
>         * gcc.dg/Wstringop-overflow-13.c: Ditto.
>         * gcc.dg/Wstringop-overflow-14.c: Ditto.
>         * gcc.dg/Wstringop-overflow-21.c: Ditto.
>         * gcc.dg/Wstringop-overflow-68.c: Ditto.
>         * gcc.dg/gomp/pr46032-2.c: Ditto.
>         * gcc.dg/gomp/pr46032-3.c: Ditto.
>         * gcc.dg/gomp/simd-2.c: Ditto.
>         * gcc.dg/gomp/simd-3.c: Ditto.
>         * gcc.dg/graphite/fuse-1.c: Ditto.
>         * gcc.dg/pr67089-6.c: Ditto.
>         * gcc.dg/pr82929-2.c: Ditto.
>         * gcc.dg/pr82929.c: Ditto.
>         * gcc.dg/store_merging_1.c: Ditto.
>         * gcc.dg/store_merging_11.c: Ditto.
>         * gcc.dg/store_merging_15.c: Ditto.
>         * gcc.dg/store_merging_16.c: Ditto.
>         * gcc.dg/store_merging_19.c: Ditto.
>         * gcc.dg/store_merging_24.c: Ditto.
>         * gcc.dg/store_merging_25.c: Ditto.
>         * gcc.dg/store_merging_28.c: Ditto.
>         * gcc.dg/store_merging_30.c: Ditto.
>         * gcc.dg/store_merging_5.c: Ditto.
>         * gcc.dg/store_merging_7.c: Ditto.
>         * gcc.dg/store_merging_8.c: Ditto.
>         * gcc.dg/strlenopt-85.c: Ditto.
>         * gcc.dg/tree-ssa/dump-6.c: Ditto.
>         * gcc.dg/tree-ssa/pr19210-1.c: Ditto.
>         * gcc.dg/tree-ssa/pr47059.c: Ditto.
>         * gcc.dg/tree-ssa/pr86017.c: Ditto.
>         * gcc.dg/tree-ssa/pr91482.c: Ditto.
>         * gcc.dg/tree-ssa/predcom-1.c: Ditto.
>         * gcc.dg/tree-ssa/predcom-dse-3.c: Ditto.
>         * gcc.dg/tree-ssa/prefetch-3.c: Ditto.
>         * gcc.dg/tree-ssa/prefetch-6.c: Ditto.
>         * gcc.dg/tree-ssa/prefetch-8.c: Ditto.
>         * gcc.dg/tree-ssa/prefetch-9.c: Ditto.
>         * gcc.dg/tree-ssa/ssa-dse-18.c: Ditto.
>         * gcc.dg/tree-ssa/ssa-dse-19.c: Ditto.
>         * gcc.dg/uninit-40.c: Ditto.
>         * gcc.dg/unroll-7.c: Ditto.
>         * gcc.misc-tests/help.exp: Ditto.
>         * gcc.target/i386/avx512er-vrcp28ps-4.c: Ditto.
>         * gcc.target/i386/avx512er-vrsqrt28ps-4.c: Ditto.
>         * gcc.target/i386/avx512er-vrsqrt28ps-6.c: Ditto.
>         * gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
>         * gcc.target/i386/pr22141.c: Ditto.
>         * gcc.target/i386/pr34012.c: Ditto.
>         * gcc.target/i386/pr49781-1.c: Ditto.
>         * gcc.target/i386/pr52252-atom.c: Ditto.
>         * gcc.target/i386/pr52252-core.c: Ditto.
>         * gcc.target/i386/pr60451.c: Ditto.
>         * gcc.target/i386/pr61403.c: Ditto.
>         * gcc.target/i386/pr68483-1.c: Ditto.
>         * gcc.target/i386/pr82460-2.c: Ditto.
>         * gcc.target/i386/pr95798-1.c: Ditto.
>         * gcc.target/i386/pr95798-2.c: Ditto.
>         * gcc.target/i386/pr98365.c: Ditto.
>         * gcc.target/i386/vect-abs-s16.c: Ditto.
>         * gcc.target/i386/vect-abs-s32.c: Ditto.
>         * gcc.target/i386/vect-abs-s8.c: Ditto.
>         * gcc.target/i386/vect-pack-trunc-1.c: Ditto.
>         * gcc.target/i386/vect-pack-trunc-2.c: Ditto.
>         * gcc.target/i386/vect-perm-even-1.c: Ditto.
>         * gcc.target/i386/vect-perm-odd-1.c: Ditto.
>         * gcc.target/i386/vect-pr67800.c: Ditto.
>         * gcc.target/i386/vect-unpack-1.c: Ditto.
>         * gcc.target/i386/vect-unpack-2.c: Ditto.
>         * gcc.target/i386/vect-unpack-3.c: Ditto.
>         * gfortran.dg/pr77498.f: Ditto.
> ---
>  gcc/opts.c                                                  | 6 +++---
>  gcc/testsuite/c-c++-common/Wstringop-overflow-2.c           | 2 +-
>  gcc/testsuite/g++.dg/tree-ssa/pr81408.C                     | 2 +-
>  gcc/testsuite/g++.dg/warn/Wuninitialized-13.C               | 2 +-
>  gcc/testsuite/gcc.dg/Warray-bounds-51.c                     | 2 +-
>  gcc/testsuite/gcc.dg/Warray-parameter-3.c                   | 2 +-
>  gcc/testsuite/gcc.dg/Wstringop-overflow-13.c                | 2 +-
>  gcc/testsuite/gcc.dg/Wstringop-overflow-14.c                | 2 +-
>  gcc/testsuite/gcc.dg/Wstringop-overflow-21.c                | 2 +-
>  gcc/testsuite/gcc.dg/Wstringop-overflow-68.c                | 2 +-
>  gcc/testsuite/gcc.dg/gomp/pr46032-2.c                       | 2 +-
>  gcc/testsuite/gcc.dg/gomp/pr46032-3.c                       | 2 +-
>  gcc/testsuite/gcc.dg/gomp/simd-2.c                          | 2 +-
>  gcc/testsuite/gcc.dg/gomp/simd-3.c                          | 2 +-
>  gcc/testsuite/gcc.dg/graphite/fuse-1.c                      | 2 +-
>  gcc/testsuite/gcc.dg/pr67089-6.c                            | 2 +-
>  gcc/testsuite/gcc.dg/pr82929-2.c                            | 2 +-
>  gcc/testsuite/gcc.dg/pr82929.c                              | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_1.c                      | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_11.c                     | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_15.c                     | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_16.c                     | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_19.c                     | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_24.c                     | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_25.c                     | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_28.c                     | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_30.c                     | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_5.c                      | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_7.c                      | 2 +-
>  gcc/testsuite/gcc.dg/store_merging_8.c                      | 2 +-
>  gcc/testsuite/gcc.dg/strlenopt-85.c                         | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/dump-6.c                      | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c                   | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/pr47059.c                     | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/pr86017.c                     | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/pr91482.c                     | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c                   | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c               | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c                  | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c                  | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c                  | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c                  | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c                  | 2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c                  | 2 +-
>  gcc/testsuite/gcc.dg/uninit-40.c                            | 2 +-
>  gcc/testsuite/gcc.dg/unroll-7.c                             | 2 +-
>  gcc/testsuite/gcc.misc-tests/help.exp                       | 2 +-
>  gcc/testsuite/gcc.target/i386/avx512er-vrcp28ps-4.c         | 2 +-
>  gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c       | 2 +-
>  gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c       | 2 +-
>  .../gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c          | 2 +-
>  gcc/testsuite/gcc.target/i386/pr22141.c                     | 2 +-
>  gcc/testsuite/gcc.target/i386/pr34012.c                     | 2 +-
>  gcc/testsuite/gcc.target/i386/pr49781-1.c                   | 2 +-
>  gcc/testsuite/gcc.target/i386/pr52252-atom.c                | 2 +-
>  gcc/testsuite/gcc.target/i386/pr52252-core.c                | 2 +-
>  gcc/testsuite/gcc.target/i386/pr60451.c                     | 2 +-
>  gcc/testsuite/gcc.target/i386/pr61403.c                     | 2 +-
>  gcc/testsuite/gcc.target/i386/pr68483-1.c                   | 2 +-
>  gcc/testsuite/gcc.target/i386/pr82460-2.c                   | 2 +-
>  gcc/testsuite/gcc.target/i386/pr95798-1.c                   | 2 +-
>  gcc/testsuite/gcc.target/i386/pr95798-2.c                   | 2 +-
>  gcc/testsuite/gcc.target/i386/pr98365.c                     | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-abs-s16.c                | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-abs-s32.c                | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-abs-s8.c                 | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c           | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c           | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-perm-even-1.c            | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c             | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-pr67800.c                | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-unpack-1.c               | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-unpack-2.c               | 2 +-
>  gcc/testsuite/gcc.target/i386/vect-unpack-3.c               | 2 +-
>  gcc/testsuite/gfortran.dg/pr77498.f                         | 2 +-
>  75 files changed, 77 insertions(+), 77 deletions(-)
>
> diff --git a/gcc/opts.c b/gcc/opts.c
> index e0501551ef5..ec6e2a4dc59 100644
> --- a/gcc/opts.c
> +++ b/gcc/opts.c
> @@ -623,10 +623,12 @@ static const struct default_options default_options_table[] =
>      { OPT_LEVELS_2_PLUS, OPT_fstore_merging, NULL, 1 },
>      { OPT_LEVELS_2_PLUS, OPT_fthread_jumps, NULL, 1 },
>      { OPT_LEVELS_2_PLUS, OPT_ftree_pre, NULL, 1 },
> +    { OPT_LEVELS_2_PLUS, OPT_ftree_loop_vectorize, NULL, 1 },
> +    { OPT_LEVELS_2_PLUS, OPT_ftree_slp_vectorize, NULL, 1 },
>      { 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 },
>
> @@ -655,9 +657,7 @@ static const struct default_options default_options_table[] =
>      { 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 },
> diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> index 1d79930cd58..9351f7e7a1a 100644
> --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> @@ -1,7 +1,7 @@
>  /* PR middle-end/91458 - inconsistent warning for writing past the end
>     of an array member
>     { dg-do compile }
> -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
>
>  void sink (void*);
>
> diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
> index 39e32fd4bc9..bc14309480c 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 49ee878806a..60e8dd4f0e2 100644
> --- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> +++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> @@ -1,6 +1,6 @@
>  /* PR c/98597 - ICE in -Wuninitialized printing a MEM_REF
>     { dg-do compile }
> -   { dg-options "-O2 -Wall" } */
> +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
>
>  struct shared_count {
>    shared_count () { }
> diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-51.c b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> index 6028b11637c..8b81a0ccfa7 100644
> --- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> +++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> @@ -1,7 +1,7 @@
>  /* PR middle-end/92333 - missing variable name referencing VLA in warnings
>     PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
>     { dg-do compile }
> -   { dg-options "-O2 -Wall" } */
> +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
>
>  void sink (void*);
>
> diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-3.c b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> index cbf3e9339f5..fbef715aa99 100644
> --- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> +++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> @@ -59,7 +59,7 @@ void fas1 (int[static 2]);    // { dg-warning "\\\[-Warray-parameter=" }
>
>  /* Also verify that -Warray-bounds doesn't trigger for ordinary array
>     parameters...  */
> -#pragma GCC optimize "2"
> +#pragma GCC optimize ("2,-fno-tree-vectorize")
>
>  __attribute__ ((noipa)) void
>  gca3 (char a[3])
> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> index bd513151cea..a78242bf26e 100644
> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> @@ -3,7 +3,7 @@
>     PR middle-end/89911 - ICE on a call with no arguments to strnlen
>     declared with no prototype
>     { dg-do compile }
> -   { dg-options "-O2 -Wall" } */
> +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
>
>  typedef __SIZE_TYPE__ size_t;
>
> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> index d6201b068b6..808bf87c386 100644
> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> @@ -2,7 +2,7 @@
>     types than char are diagnosed.
>     { dg-do compile }
>     { dg-require-effective-target int32plus }
> -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> +   { dg-options "-O2 -fno-tree-vectorize -Wall -Wno-array-bounds" } */
>
>  typedef __INT16_TYPE__  int16_t;
>  typedef __INT32_TYPE__  int32_t;
> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> index 3a27460220c..f418a17ca93 100644
> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> @@ -1,7 +1,7 @@
>  /* PR middle-end/92312 - bogus -Wstringop-overflow storing into a trailing
>     array backed by larger buffer
>     { dg-do compile }
> -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-tree-vectorize" } */
>
>  struct S0 { char a, b[0]; };
>
> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> index 6bcba274541..7cc1012130c 100644
> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> @@ -2,7 +2,7 @@
>     a larger scalar into a smaller array
>     Verify overflow by aggregate stores.
>     { dg-do compile }
> -   { dg-options "-O2" } */
> +   { dg-options "-O2 -fno-tree-vectorize" } */
>
>  #define A(N) (A ## N)
>  #define Ac1 (AC1){ 0 }
> diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
> index e110880bd8e..2e562618489 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 a4af7ec4a8a..da1ab487385 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 85acb980f10..f4912127b81 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 86fee858673..c75060c07ae 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 527b6e5c415..61289d312c2 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 db2ffdfeca4..b59d75b2318 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 3442f91af02..b886f1cce76 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 bb84f2b21a3..123e1919cec 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 4cc43dfd9e1..91ca925be0e 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 2ec2394afb9..60ed5cd8bf9 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_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
> index acd7de571f8..13fcca4aa11 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 9545dcce3de..cd83f1c0fe5 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 0841bb4deee..0a2bbc4bfde 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 744fe60e8e0..5291bb9e986 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 cf182190e91..96611b5e57b 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 2d6cffc4694..fadb7fff993 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 694d560a621..baf94efe733 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 6e7c72510ff..b0cb0da78e0 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 c744ece6407..dbe000a463e 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 e710a544ff0..d719e0a2257 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 e049e0c30e0..2ba1ee05700 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 70659c00c0e..6c803908781 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 50d86a00485..b9e40e964c1 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 9f9c61aa213..860cde12c0f 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 f216e83c7b3..c7ef73ad59e 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 7d6a724e4ad..0ddad573129 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 f68be2b3379..8c3d9a4fc58 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 ec08d6c0318..1fc8f089345 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 467903bf3fc..46f0d0c2317 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 12f09016943..3fa71685ace 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 cbd6a80d345..00f41c3e4f4 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 da4847320b1..e8848c30acc 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 92b2df80ec8..2e7b5b496ea 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 718b7466e50..7bb8d060631 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 c015191ca32..8708079d397 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 055369bf8b1..695af5757cc 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 5e034d26947..eb6d8686c6a 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=target,optimizers" "" "" ""
>  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/avx512er-vrcp28ps-4.c b/gcc/testsuite/gcc.target/i386/avx512er-vrcp28ps-4.c
> index 2c76d967184..9f90dfded8b 100644
> --- a/gcc/testsuite/gcc.target/i386/avx512er-vrcp28ps-4.c
> +++ b/gcc/testsuite/gcc.target/i386/avx512er-vrcp28ps-4.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx512er" } */
> +/* { dg-options "-O2 -ffast-math -fvect-cost-model=cheap -mavx512er" } */
>
>  #include "avx512er-vrcp28ps-3.c"
>
> diff --git a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c
> index 2f5f73fd781..ef6cedcc768 100644
> --- a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c
> +++ b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx512er" } */
> +/* { dg-options "-O2 -ffast-math -fvect-cost-model=cheap -mavx512er" } */
>
>  #include "avx512er-vrsqrt28ps-3.c"
>
> diff --git a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c
> index 77c5cba1cef..aa6fd4c62cb 100644
> --- a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c
> +++ b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx512er" } */
> +/* { dg-options "-O2 -ffast-math -fvect-cost-model=cheap -mavx512er" } */
>
>  #include "avx512er-vrsqrt28ps-5.c"
>
> diff --git a/gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c b/gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c
> index 709cd21e671..a732bc466db 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/pr22141.c b/gcc/testsuite/gcc.target/i386/pr22141.c
> index 036422e8ccf..b68b97f3f72 100644
> --- a/gcc/testsuite/gcc.target/i386/pr22141.c
> +++ b/gcc/testsuite/gcc.target/i386/pr22141.c
> @@ -1,6 +1,6 @@
>  /* PR middle-end/22141 */
>  /* { dg-do compile } */
> -/* { dg-options "-Os" } */
> +/* { dg-options "-Os -fno-tree-vectorize" } */
>
>  extern void abort (void);
>
> diff --git a/gcc/testsuite/gcc.target/i386/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
> index d0cffa05290..1c1f0eea52e 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 60f9d50d866..d5a2e32db97 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/pr52252-atom.c b/gcc/testsuite/gcc.target/i386/pr52252-atom.c
> index ee604f2189a..3761bf3614e 100644
> --- a/gcc/testsuite/gcc.target/i386/pr52252-atom.c
> +++ b/gcc/testsuite/gcc.target/i386/pr52252-atom.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -mssse3 -mtune=slm" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -mssse3 -mtune=slm" } */
>  #define byte unsigned char
>
>  void
> diff --git a/gcc/testsuite/gcc.target/i386/pr52252-core.c b/gcc/testsuite/gcc.target/i386/pr52252-core.c
> index 65d62cfa365..df0f75c5b1b 100644
> --- a/gcc/testsuite/gcc.target/i386/pr52252-core.c
> +++ b/gcc/testsuite/gcc.target/i386/pr52252-core.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -mssse3 -mtune=corei7" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -mssse3 -mtune=corei7" } */
>  #define byte unsigned char
>
>  void
> diff --git a/gcc/testsuite/gcc.target/i386/pr60451.c b/gcc/testsuite/gcc.target/i386/pr60451.c
> index 2396ba81da1..c1bca753783 100644
> --- a/gcc/testsuite/gcc.target/i386/pr60451.c
> +++ b/gcc/testsuite/gcc.target/i386/pr60451.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -msse2" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -msse2" } */
>
>  void
>  foo (unsigned char *a, unsigned char *b, unsigned char *c, int size)
> diff --git a/gcc/testsuite/gcc.target/i386/pr61403.c b/gcc/testsuite/gcc.target/i386/pr61403.c
> index 48c7ba68d78..b9165a4ed81 100644
> --- a/gcc/testsuite/gcc.target/i386/pr61403.c
> +++ b/gcc/testsuite/gcc.target/i386/pr61403.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse4.2 -mtune=corei7" } */
> +/* { dg-options "-O2 -ffast-math -fvect-cost-model=cheap -msse4.2 -mtune=corei7" } */
>  /* { dg-require-effective-target c99_runtime } */
>
>  #include <math.h>
> diff --git a/gcc/testsuite/gcc.target/i386/pr68483-1.c b/gcc/testsuite/gcc.target/i386/pr68483-1.c
> index 29787e94bd3..493d6a9011a 100644
> --- a/gcc/testsuite/gcc.target/i386/pr68483-1.c
> +++ b/gcc/testsuite/gcc.target/i386/pr68483-1.c
> @@ -1,6 +1,6 @@
>  /* PR target/68483 */
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse3" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -msse2 -mno-sse3" } */
>
>  void
>  test (int *input, int *out, unsigned x1, unsigned x2)
> diff --git a/gcc/testsuite/gcc.target/i386/pr82460-2.c b/gcc/testsuite/gcc.target/i386/pr82460-2.c
> index 8cdfb54f56a..72076d490e2 100644
> --- a/gcc/testsuite/gcc.target/i386/pr82460-2.c
> +++ b/gcc/testsuite/gcc.target/i386/pr82460-2.c
> @@ -1,6 +1,6 @@
>  /* PR target/82460 */
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -mavx512vbmi -mprefer-vector-width=none --param=vect-epilogues-nomask=0" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -mavx512vbmi -mprefer-vector-width=none --param=vect-epilogues-nomask=0" } */
>  /* We want to reuse the permutation mask in the loop, so use vpermt2b rather
>     than vpermi2b.  */
>  /* { dg-final { scan-assembler-not {\mvpermi2b\M} } } */
> diff --git a/gcc/testsuite/gcc.target/i386/pr95798-1.c b/gcc/testsuite/gcc.target/i386/pr95798-1.c
> index 9a7e32d6f2f..526f48921fd 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 c670d3780e8..6b5c5a73e96 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/gcc.target/i386/pr98365.c b/gcc/testsuite/gcc.target/i386/pr98365.c
> index 652210dcdd5..6bb58d08fe5 100644
> --- a/gcc/testsuite/gcc.target/i386/pr98365.c
> +++ b/gcc/testsuite/gcc.target/i386/pr98365.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -mavx2 -ftree-vectorize -fdump-tree-vect-details" } */
> +/* { dg-options "-O2 -mavx2 -fvect-cost-model=cheap -fdump-tree-vect-details" } */
>  /* { dg-final { scan-tree-dump-times "vectorized \[1-3] loops" 2 "vect" } } */
>  short foo1 (short* a, short* c, int n)
>  {
> diff --git a/gcc/testsuite/gcc.target/i386/vect-abs-s16.c b/gcc/testsuite/gcc.target/i386/vect-abs-s16.c
> index 266599f8ea2..b4c54129c39 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-abs-s16.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-abs-s16.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse3 -fdump-tree-vect-details" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -msse2 -mno-sse3 -fdump-tree-vect-details" } */
>
>  int abs (int);
>
> diff --git a/gcc/testsuite/gcc.target/i386/vect-abs-s32.c b/gcc/testsuite/gcc.target/i386/vect-abs-s32.c
> index 0a6bdac60f7..f14380556c4 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-abs-s32.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-abs-s32.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse3 -fdump-tree-vect-details" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -msse2 -mno-sse3 -fdump-tree-vect-details" } */
>
>  int abs (int);
>
> diff --git a/gcc/testsuite/gcc.target/i386/vect-abs-s8.c b/gcc/testsuite/gcc.target/i386/vect-abs-s8.c
> index d6e31976f40..7a965a0295a 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-abs-s8.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-abs-s8.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse3 -fdump-tree-vect-details" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -msse2 -mno-sse3 -fdump-tree-vect-details" } */
>
>  int abs (int);
>
> diff --git a/gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c b/gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c
> index 1b468e47754..08c30a35e70 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c
> @@ -1,5 +1,5 @@
>  /* { dg-do run } */
> -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
>  /* { dg-require-effective-target avx512bw } */
>
>  #include "avx512bw-check.h"
> diff --git a/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c b/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c
> index 3503deaa9d9..ebb6f5c578e 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c
> @@ -1,5 +1,5 @@
>  /* { dg-do run } */
> -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
>  /* { dg-require-effective-target avx512bw } */
>
>  #include "avx512bw-check.h"
> diff --git a/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c b/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c
> index 3de4dfabeea..e8507f49b1d 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c
> @@ -1,5 +1,5 @@
>  /* { dg-do run } */
> -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
>  /* { dg-require-effective-target avx512bw } */
>
>  #include "avx512bw-check.h"
> diff --git a/gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c b/gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c
> index e32d40a1bac..37514f4737e 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c
> @@ -1,5 +1,5 @@
>  /* { dg-do run } */
> -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
>  /* { dg-require-effective-target avx512bw } */
>
>  #include "avx512bw-check.h"
> diff --git a/gcc/testsuite/gcc.target/i386/vect-pr67800.c b/gcc/testsuite/gcc.target/i386/vect-pr67800.c
> index 8bd308c83f6..31cd7970206 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-pr67800.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-pr67800.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -msse4.2" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -fdump-tree-vect-details -msse4.2" } */
>
>  #define ubyte unsigned char
>  #define byte char
> diff --git a/gcc/testsuite/gcc.target/i386/vect-unpack-1.c b/gcc/testsuite/gcc.target/i386/vect-unpack-1.c
> index 84521e313e5..f572e4c8085 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-unpack-1.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-unpack-1.c
> @@ -1,5 +1,5 @@
>  /* { dg-do run } */
> -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
>  /* { dg-require-effective-target avx512bw } */
>
>  #include "avx512bw-check.h"
> diff --git a/gcc/testsuite/gcc.target/i386/vect-unpack-2.c b/gcc/testsuite/gcc.target/i386/vect-unpack-2.c
> index 51c518e6111..7234afddd4c 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-unpack-2.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-unpack-2.c
> @@ -1,5 +1,5 @@
>  /* { dg-do run } */
> -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
>  /* { dg-require-effective-target avx512bw } */
>
>  #include "avx512bw-check.h"
> diff --git a/gcc/testsuite/gcc.target/i386/vect-unpack-3.c b/gcc/testsuite/gcc.target/i386/vect-unpack-3.c
> index eb8a93e9eea..08e9827afcc 100644
> --- a/gcc/testsuite/gcc.target/i386/vect-unpack-3.c
> +++ b/gcc/testsuite/gcc.target/i386/vect-unpack-3.c
> @@ -1,5 +1,5 @@
>  /* { dg-do run } */
> -/* { dg-options "-O2 -fdump-tree-vect-details -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> +/* { dg-options "-O2 -fdump-tree-vect-details -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
>  /* { dg-require-effective-target avx512bw } */
>
>  #include "avx512bw-check.h"
> diff --git a/gcc/testsuite/gfortran.dg/pr77498.f b/gcc/testsuite/gfortran.dg/pr77498.f
> index f957b57bb00..a0fc8275a84 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
> --
> 2.27.0
>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-06  9:18 ` Richard Biener
@ 2021-09-06  9:41   ` Jakub Jelinek
  2021-09-06 10:58     ` Hongtao Liu
  2021-09-06 11:05     ` Richard Biener
  2021-09-06  9:41   ` Hongtao Liu
  1 sibling, 2 replies; 39+ messages in thread
From: Jakub Jelinek @ 2021-09-06  9:41 UTC (permalink / raw)
  To: Richard Biener; +Cc: liuhongt, GCC Patches

On Mon, Sep 06, 2021 at 11:18:47AM +0200, Richard Biener wrote:
> On Mon, Sep 6, 2021 at 10:47 AM liuhongt via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> >
> > Hi:
> >   As discussed in [1], most of (currently unopposed) targets want
> > auto-vectorization at O2, and IMHO now would be a good time to enable O2
> > vectorization for GCC trunk, so it would leave enough time to expose
> > related issues and fix them.
> >
> >   Bootstrapped and regtested on x86_64-linux-gnu{-m32,}
> >   Ok for trunk?
> 
> It changes the cost model used when the user specifices
> -O2 -ftree-vectorize which used 'cheap' before but now sticks to
> 'very-cheap'.  I guess adjusting the cost model in process_options
> might be possible when any(?) of the vectorizer flags were set
> explicitly?

process_options would mean it affects only the command line and not
__attribute__((optimize ("O2", "ftree-vectorize")))
etc.
So, shouldn't it be instead done in default_options_optimization, somewhere
among the
  if (openacc_mode)
    SET_OPTION_IF_UNSET (opts, opts_set, flag_ipa_pta, true);

  /* Track fields in field-sensitive alias analysis.  */
  if (opt2)
    SET_OPTION_IF_UNSET (opts, opts_set, param_max_fields_for_field_sensitive,
                         100);

  if (opts->x_optimize_size)
    /* We want to crossjump as much as possible.  */
    SET_OPTION_IF_UNSET (opts, opts_set, param_min_crossjump_insns, 1);

  /* Restrict the amount of work combine does at -Og while retaining
     most of its useful transforms.  */
  if (opts->x_optimize_debug)
    SET_OPTION_IF_UNSET (opts, opts_set, param_max_combine_insns, 2);
in there?
Like:
  /* 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_ftree_loop_vectorize
	  || opts_set->x_ftree_slp_vectorize))
    SET_OPTION_IF_UNSET (opts, opts_set, fvect_cost_model_,
			 VECT_COST_MODEL_CHEAP);
Though, unsure if that will work with -O2 -ftree-vectorize which is an
option without flag with EnabledBy on the other two options.

Also, is:
+    { OPT_LEVELS_2_PLUS, OPT_ftree_loop_vectorize, NULL, 1 },
+    { OPT_LEVELS_2_PLUS, OPT_ftree_slp_vectorize, NULL, 1 },
what we really want, isn't that instead:
+    { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_ftree_loop_vectorize, NULL, 1 },
+    { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_ftree_slp_vectorize, NULL, 1 },
?  I mean, for -Os vectorization even in very-cheap model I'd think it
usually enlarges code size, and for -Og it is seriously harmful for
debugging experience, especially when DWARF <= 5 doesn't have anything that
would help debugging vectorized loops.

	Jakub


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-06  9:18 ` Richard Biener
  2021-09-06  9:41   ` Jakub Jelinek
@ 2021-09-06  9:41   ` Hongtao Liu
  1 sibling, 0 replies; 39+ messages in thread
From: Hongtao Liu @ 2021-09-06  9:41 UTC (permalink / raw)
  To: Richard Biener; +Cc: liuhongt, Jakub Jelinek, GCC Patches

On Mon, Sep 6, 2021 at 5:19 PM Richard Biener via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Mon, Sep 6, 2021 at 10:47 AM liuhongt via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> >
> > Hi:
> >   As discussed in [1], most of (currently unopposed) targets want
> > auto-vectorization at O2, and IMHO now would be a good time to enable O2
> > vectorization for GCC trunk, so it would leave enough time to expose
> > related issues and fix them.
> >
> >   Bootstrapped and regtested on x86_64-linux-gnu{-m32,}
> >   Ok for trunk?
>
> It changes the cost model used when the user specifices
> -O2 -ftree-vectorize which used 'cheap' before but now sticks to
> 'very-cheap'.  I guess adjusting the cost model in process_options
> might be possible when any(?) of the vectorizer flags were set
> explicitly?
So you're meaning the cheap cost model should be binded to
-ftree-vectorize even for -O1 -ftree-vectorize.
>
> Richard.
>
> > PS:
> >   Other targets(than x86) may also need to adjust some tests under gcc.target/,
> > this patch only adjusts gcc.target/i386 and other common tests.
> >
> > [1] https://gcc.gnu.org/pipermail/gcc/2021-September/237211.html
> > gcc/ChangeLog:
> >
> >         * opts.c (default_options_table): Enable auto-vectorization at
> >         O2 with very-cheap cost model.
> >
> > gcc/testsuite/ChangeLog:
> >
> >         * c-c++-common/Wstringop-overflow-2.c: Adjust testcase.
> >         * g++.dg/tree-ssa/pr81408.C: Ditto.
> >         * g++.dg/warn/Wuninitialized-13.C: Ditto.
> >         * gcc.dg/Warray-bounds-51.c: Ditto.
> >         * gcc.dg/Warray-parameter-3.c: Ditto.
> >         * gcc.dg/Wstringop-overflow-13.c: Ditto.
> >         * gcc.dg/Wstringop-overflow-14.c: Ditto.
> >         * gcc.dg/Wstringop-overflow-21.c: Ditto.
> >         * gcc.dg/Wstringop-overflow-68.c: Ditto.
> >         * gcc.dg/gomp/pr46032-2.c: Ditto.
> >         * gcc.dg/gomp/pr46032-3.c: Ditto.
> >         * gcc.dg/gomp/simd-2.c: Ditto.
> >         * gcc.dg/gomp/simd-3.c: Ditto.
> >         * gcc.dg/graphite/fuse-1.c: Ditto.
> >         * gcc.dg/pr67089-6.c: Ditto.
> >         * gcc.dg/pr82929-2.c: Ditto.
> >         * gcc.dg/pr82929.c: Ditto.
> >         * gcc.dg/store_merging_1.c: Ditto.
> >         * gcc.dg/store_merging_11.c: Ditto.
> >         * gcc.dg/store_merging_15.c: Ditto.
> >         * gcc.dg/store_merging_16.c: Ditto.
> >         * gcc.dg/store_merging_19.c: Ditto.
> >         * gcc.dg/store_merging_24.c: Ditto.
> >         * gcc.dg/store_merging_25.c: Ditto.
> >         * gcc.dg/store_merging_28.c: Ditto.
> >         * gcc.dg/store_merging_30.c: Ditto.
> >         * gcc.dg/store_merging_5.c: Ditto.
> >         * gcc.dg/store_merging_7.c: Ditto.
> >         * gcc.dg/store_merging_8.c: Ditto.
> >         * gcc.dg/strlenopt-85.c: Ditto.
> >         * gcc.dg/tree-ssa/dump-6.c: Ditto.
> >         * gcc.dg/tree-ssa/pr19210-1.c: Ditto.
> >         * gcc.dg/tree-ssa/pr47059.c: Ditto.
> >         * gcc.dg/tree-ssa/pr86017.c: Ditto.
> >         * gcc.dg/tree-ssa/pr91482.c: Ditto.
> >         * gcc.dg/tree-ssa/predcom-1.c: Ditto.
> >         * gcc.dg/tree-ssa/predcom-dse-3.c: Ditto.
> >         * gcc.dg/tree-ssa/prefetch-3.c: Ditto.
> >         * gcc.dg/tree-ssa/prefetch-6.c: Ditto.
> >         * gcc.dg/tree-ssa/prefetch-8.c: Ditto.
> >         * gcc.dg/tree-ssa/prefetch-9.c: Ditto.
> >         * gcc.dg/tree-ssa/ssa-dse-18.c: Ditto.
> >         * gcc.dg/tree-ssa/ssa-dse-19.c: Ditto.
> >         * gcc.dg/uninit-40.c: Ditto.
> >         * gcc.dg/unroll-7.c: Ditto.
> >         * gcc.misc-tests/help.exp: Ditto.
> >         * gcc.target/i386/avx512er-vrcp28ps-4.c: Ditto.
> >         * gcc.target/i386/avx512er-vrsqrt28ps-4.c: Ditto.
> >         * gcc.target/i386/avx512er-vrsqrt28ps-6.c: Ditto.
> >         * gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
> >         * gcc.target/i386/pr22141.c: Ditto.
> >         * gcc.target/i386/pr34012.c: Ditto.
> >         * gcc.target/i386/pr49781-1.c: Ditto.
> >         * gcc.target/i386/pr52252-atom.c: Ditto.
> >         * gcc.target/i386/pr52252-core.c: Ditto.
> >         * gcc.target/i386/pr60451.c: Ditto.
> >         * gcc.target/i386/pr61403.c: Ditto.
> >         * gcc.target/i386/pr68483-1.c: Ditto.
> >         * gcc.target/i386/pr82460-2.c: Ditto.
> >         * gcc.target/i386/pr95798-1.c: Ditto.
> >         * gcc.target/i386/pr95798-2.c: Ditto.
> >         * gcc.target/i386/pr98365.c: Ditto.
> >         * gcc.target/i386/vect-abs-s16.c: Ditto.
> >         * gcc.target/i386/vect-abs-s32.c: Ditto.
> >         * gcc.target/i386/vect-abs-s8.c: Ditto.
> >         * gcc.target/i386/vect-pack-trunc-1.c: Ditto.
> >         * gcc.target/i386/vect-pack-trunc-2.c: Ditto.
> >         * gcc.target/i386/vect-perm-even-1.c: Ditto.
> >         * gcc.target/i386/vect-perm-odd-1.c: Ditto.
> >         * gcc.target/i386/vect-pr67800.c: Ditto.
> >         * gcc.target/i386/vect-unpack-1.c: Ditto.
> >         * gcc.target/i386/vect-unpack-2.c: Ditto.
> >         * gcc.target/i386/vect-unpack-3.c: Ditto.
> >         * gfortran.dg/pr77498.f: Ditto.
> > ---
> >  gcc/opts.c                                                  | 6 +++---
> >  gcc/testsuite/c-c++-common/Wstringop-overflow-2.c           | 2 +-
> >  gcc/testsuite/g++.dg/tree-ssa/pr81408.C                     | 2 +-
> >  gcc/testsuite/g++.dg/warn/Wuninitialized-13.C               | 2 +-
> >  gcc/testsuite/gcc.dg/Warray-bounds-51.c                     | 2 +-
> >  gcc/testsuite/gcc.dg/Warray-parameter-3.c                   | 2 +-
> >  gcc/testsuite/gcc.dg/Wstringop-overflow-13.c                | 2 +-
> >  gcc/testsuite/gcc.dg/Wstringop-overflow-14.c                | 2 +-
> >  gcc/testsuite/gcc.dg/Wstringop-overflow-21.c                | 2 +-
> >  gcc/testsuite/gcc.dg/Wstringop-overflow-68.c                | 2 +-
> >  gcc/testsuite/gcc.dg/gomp/pr46032-2.c                       | 2 +-
> >  gcc/testsuite/gcc.dg/gomp/pr46032-3.c                       | 2 +-
> >  gcc/testsuite/gcc.dg/gomp/simd-2.c                          | 2 +-
> >  gcc/testsuite/gcc.dg/gomp/simd-3.c                          | 2 +-
> >  gcc/testsuite/gcc.dg/graphite/fuse-1.c                      | 2 +-
> >  gcc/testsuite/gcc.dg/pr67089-6.c                            | 2 +-
> >  gcc/testsuite/gcc.dg/pr82929-2.c                            | 2 +-
> >  gcc/testsuite/gcc.dg/pr82929.c                              | 2 +-
> >  gcc/testsuite/gcc.dg/store_merging_1.c                      | 2 +-
> >  gcc/testsuite/gcc.dg/store_merging_11.c                     | 2 +-
> >  gcc/testsuite/gcc.dg/store_merging_15.c                     | 2 +-
> >  gcc/testsuite/gcc.dg/store_merging_16.c                     | 2 +-
> >  gcc/testsuite/gcc.dg/store_merging_19.c                     | 2 +-
> >  gcc/testsuite/gcc.dg/store_merging_24.c                     | 2 +-
> >  gcc/testsuite/gcc.dg/store_merging_25.c                     | 2 +-
> >  gcc/testsuite/gcc.dg/store_merging_28.c                     | 2 +-
> >  gcc/testsuite/gcc.dg/store_merging_30.c                     | 2 +-
> >  gcc/testsuite/gcc.dg/store_merging_5.c                      | 2 +-
> >  gcc/testsuite/gcc.dg/store_merging_7.c                      | 2 +-
> >  gcc/testsuite/gcc.dg/store_merging_8.c                      | 2 +-
> >  gcc/testsuite/gcc.dg/strlenopt-85.c                         | 2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/dump-6.c                      | 2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c                   | 2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/pr47059.c                     | 2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/pr86017.c                     | 2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/pr91482.c                     | 2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c                   | 2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c               | 2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c                  | 2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c                  | 2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c                  | 2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c                  | 2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c                  | 2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c                  | 2 +-
> >  gcc/testsuite/gcc.dg/uninit-40.c                            | 2 +-
> >  gcc/testsuite/gcc.dg/unroll-7.c                             | 2 +-
> >  gcc/testsuite/gcc.misc-tests/help.exp                       | 2 +-
> >  gcc/testsuite/gcc.target/i386/avx512er-vrcp28ps-4.c         | 2 +-
> >  gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c       | 2 +-
> >  gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c       | 2 +-
> >  .../gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c          | 2 +-
> >  gcc/testsuite/gcc.target/i386/pr22141.c                     | 2 +-
> >  gcc/testsuite/gcc.target/i386/pr34012.c                     | 2 +-
> >  gcc/testsuite/gcc.target/i386/pr49781-1.c                   | 2 +-
> >  gcc/testsuite/gcc.target/i386/pr52252-atom.c                | 2 +-
> >  gcc/testsuite/gcc.target/i386/pr52252-core.c                | 2 +-
> >  gcc/testsuite/gcc.target/i386/pr60451.c                     | 2 +-
> >  gcc/testsuite/gcc.target/i386/pr61403.c                     | 2 +-
> >  gcc/testsuite/gcc.target/i386/pr68483-1.c                   | 2 +-
> >  gcc/testsuite/gcc.target/i386/pr82460-2.c                   | 2 +-
> >  gcc/testsuite/gcc.target/i386/pr95798-1.c                   | 2 +-
> >  gcc/testsuite/gcc.target/i386/pr95798-2.c                   | 2 +-
> >  gcc/testsuite/gcc.target/i386/pr98365.c                     | 2 +-
> >  gcc/testsuite/gcc.target/i386/vect-abs-s16.c                | 2 +-
> >  gcc/testsuite/gcc.target/i386/vect-abs-s32.c                | 2 +-
> >  gcc/testsuite/gcc.target/i386/vect-abs-s8.c                 | 2 +-
> >  gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c           | 2 +-
> >  gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c           | 2 +-
> >  gcc/testsuite/gcc.target/i386/vect-perm-even-1.c            | 2 +-
> >  gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c             | 2 +-
> >  gcc/testsuite/gcc.target/i386/vect-pr67800.c                | 2 +-
> >  gcc/testsuite/gcc.target/i386/vect-unpack-1.c               | 2 +-
> >  gcc/testsuite/gcc.target/i386/vect-unpack-2.c               | 2 +-
> >  gcc/testsuite/gcc.target/i386/vect-unpack-3.c               | 2 +-
> >  gcc/testsuite/gfortran.dg/pr77498.f                         | 2 +-
> >  75 files changed, 77 insertions(+), 77 deletions(-)
> >
> > diff --git a/gcc/opts.c b/gcc/opts.c
> > index e0501551ef5..ec6e2a4dc59 100644
> > --- a/gcc/opts.c
> > +++ b/gcc/opts.c
> > @@ -623,10 +623,12 @@ static const struct default_options default_options_table[] =
> >      { OPT_LEVELS_2_PLUS, OPT_fstore_merging, NULL, 1 },
> >      { OPT_LEVELS_2_PLUS, OPT_fthread_jumps, NULL, 1 },
> >      { OPT_LEVELS_2_PLUS, OPT_ftree_pre, NULL, 1 },
> > +    { OPT_LEVELS_2_PLUS, OPT_ftree_loop_vectorize, NULL, 1 },
> > +    { OPT_LEVELS_2_PLUS, OPT_ftree_slp_vectorize, NULL, 1 },
> >      { 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 },
> >
> > @@ -655,9 +657,7 @@ static const struct default_options default_options_table[] =
> >      { 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 },
> > diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > index 1d79930cd58..9351f7e7a1a 100644
> > --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > @@ -1,7 +1,7 @@
> >  /* PR middle-end/91458 - inconsistent warning for writing past the end
> >     of an array member
> >     { dg-do compile }
> > -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
> > +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
> >
> >  void sink (void*);
> >
> > diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
> > index 39e32fd4bc9..bc14309480c 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 49ee878806a..60e8dd4f0e2 100644
> > --- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> > +++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> > @@ -1,6 +1,6 @@
> >  /* PR c/98597 - ICE in -Wuninitialized printing a MEM_REF
> >     { dg-do compile }
> > -   { dg-options "-O2 -Wall" } */
> > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> >
> >  struct shared_count {
> >    shared_count () { }
> > diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-51.c b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > index 6028b11637c..8b81a0ccfa7 100644
> > --- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > +++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > @@ -1,7 +1,7 @@
> >  /* PR middle-end/92333 - missing variable name referencing VLA in warnings
> >     PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
> >     { dg-do compile }
> > -   { dg-options "-O2 -Wall" } */
> > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> >
> >  void sink (void*);
> >
> > diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-3.c b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > index cbf3e9339f5..fbef715aa99 100644
> > --- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > +++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > @@ -59,7 +59,7 @@ void fas1 (int[static 2]);    // { dg-warning "\\\[-Warray-parameter=" }
> >
> >  /* Also verify that -Warray-bounds doesn't trigger for ordinary array
> >     parameters...  */
> > -#pragma GCC optimize "2"
> > +#pragma GCC optimize ("2,-fno-tree-vectorize")
> >
> >  __attribute__ ((noipa)) void
> >  gca3 (char a[3])
> > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > index bd513151cea..a78242bf26e 100644
> > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > @@ -3,7 +3,7 @@
> >     PR middle-end/89911 - ICE on a call with no arguments to strnlen
> >     declared with no prototype
> >     { dg-do compile }
> > -   { dg-options "-O2 -Wall" } */
> > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> >
> >  typedef __SIZE_TYPE__ size_t;
> >
> > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > index d6201b068b6..808bf87c386 100644
> > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > @@ -2,7 +2,7 @@
> >     types than char are diagnosed.
> >     { dg-do compile }
> >     { dg-require-effective-target int32plus }
> > -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> > +   { dg-options "-O2 -fno-tree-vectorize -Wall -Wno-array-bounds" } */
> >
> >  typedef __INT16_TYPE__  int16_t;
> >  typedef __INT32_TYPE__  int32_t;
> > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > index 3a27460220c..f418a17ca93 100644
> > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > @@ -1,7 +1,7 @@
> >  /* PR middle-end/92312 - bogus -Wstringop-overflow storing into a trailing
> >     array backed by larger buffer
> >     { dg-do compile }
> > -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> > +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-tree-vectorize" } */
> >
> >  struct S0 { char a, b[0]; };
> >
> > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > index 6bcba274541..7cc1012130c 100644
> > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > @@ -2,7 +2,7 @@
> >     a larger scalar into a smaller array
> >     Verify overflow by aggregate stores.
> >     { dg-do compile }
> > -   { dg-options "-O2" } */
> > +   { dg-options "-O2 -fno-tree-vectorize" } */
> >
> >  #define A(N) (A ## N)
> >  #define Ac1 (AC1){ 0 }
> > diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
> > index e110880bd8e..2e562618489 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 a4af7ec4a8a..da1ab487385 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 85acb980f10..f4912127b81 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 86fee858673..c75060c07ae 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 527b6e5c415..61289d312c2 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 db2ffdfeca4..b59d75b2318 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 3442f91af02..b886f1cce76 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 bb84f2b21a3..123e1919cec 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 4cc43dfd9e1..91ca925be0e 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 2ec2394afb9..60ed5cd8bf9 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_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
> > index acd7de571f8..13fcca4aa11 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 9545dcce3de..cd83f1c0fe5 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 0841bb4deee..0a2bbc4bfde 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 744fe60e8e0..5291bb9e986 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 cf182190e91..96611b5e57b 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 2d6cffc4694..fadb7fff993 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 694d560a621..baf94efe733 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 6e7c72510ff..b0cb0da78e0 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 c744ece6407..dbe000a463e 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 e710a544ff0..d719e0a2257 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 e049e0c30e0..2ba1ee05700 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 70659c00c0e..6c803908781 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 50d86a00485..b9e40e964c1 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 9f9c61aa213..860cde12c0f 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 f216e83c7b3..c7ef73ad59e 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 7d6a724e4ad..0ddad573129 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 f68be2b3379..8c3d9a4fc58 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 ec08d6c0318..1fc8f089345 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 467903bf3fc..46f0d0c2317 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 12f09016943..3fa71685ace 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 cbd6a80d345..00f41c3e4f4 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 da4847320b1..e8848c30acc 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 92b2df80ec8..2e7b5b496ea 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 718b7466e50..7bb8d060631 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 c015191ca32..8708079d397 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 055369bf8b1..695af5757cc 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 5e034d26947..eb6d8686c6a 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=target,optimizers" "" "" ""
> >  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/avx512er-vrcp28ps-4.c b/gcc/testsuite/gcc.target/i386/avx512er-vrcp28ps-4.c
> > index 2c76d967184..9f90dfded8b 100644
> > --- a/gcc/testsuite/gcc.target/i386/avx512er-vrcp28ps-4.c
> > +++ b/gcc/testsuite/gcc.target/i386/avx512er-vrcp28ps-4.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do compile } */
> > -/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx512er" } */
> > +/* { dg-options "-O2 -ffast-math -fvect-cost-model=cheap -mavx512er" } */
> >
> >  #include "avx512er-vrcp28ps-3.c"
> >
> > diff --git a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c
> > index 2f5f73fd781..ef6cedcc768 100644
> > --- a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c
> > +++ b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-4.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do compile } */
> > -/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx512er" } */
> > +/* { dg-options "-O2 -ffast-math -fvect-cost-model=cheap -mavx512er" } */
> >
> >  #include "avx512er-vrsqrt28ps-3.c"
> >
> > diff --git a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c
> > index 77c5cba1cef..aa6fd4c62cb 100644
> > --- a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c
> > +++ b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-6.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do compile } */
> > -/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx512er" } */
> > +/* { dg-options "-O2 -ffast-math -fvect-cost-model=cheap -mavx512er" } */
> >
> >  #include "avx512er-vrsqrt28ps-5.c"
> >
> > diff --git a/gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c b/gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c
> > index 709cd21e671..a732bc466db 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/pr22141.c b/gcc/testsuite/gcc.target/i386/pr22141.c
> > index 036422e8ccf..b68b97f3f72 100644
> > --- a/gcc/testsuite/gcc.target/i386/pr22141.c
> > +++ b/gcc/testsuite/gcc.target/i386/pr22141.c
> > @@ -1,6 +1,6 @@
> >  /* PR middle-end/22141 */
> >  /* { dg-do compile } */
> > -/* { dg-options "-Os" } */
> > +/* { dg-options "-Os -fno-tree-vectorize" } */
> >
> >  extern void abort (void);
> >
> > diff --git a/gcc/testsuite/gcc.target/i386/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
> > index d0cffa05290..1c1f0eea52e 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 60f9d50d866..d5a2e32db97 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/pr52252-atom.c b/gcc/testsuite/gcc.target/i386/pr52252-atom.c
> > index ee604f2189a..3761bf3614e 100644
> > --- a/gcc/testsuite/gcc.target/i386/pr52252-atom.c
> > +++ b/gcc/testsuite/gcc.target/i386/pr52252-atom.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do compile } */
> > -/* { dg-options "-O2 -ftree-vectorize -mssse3 -mtune=slm" } */
> > +/* { dg-options "-O2 -fvect-cost-model=cheap -mssse3 -mtune=slm" } */
> >  #define byte unsigned char
> >
> >  void
> > diff --git a/gcc/testsuite/gcc.target/i386/pr52252-core.c b/gcc/testsuite/gcc.target/i386/pr52252-core.c
> > index 65d62cfa365..df0f75c5b1b 100644
> > --- a/gcc/testsuite/gcc.target/i386/pr52252-core.c
> > +++ b/gcc/testsuite/gcc.target/i386/pr52252-core.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do compile } */
> > -/* { dg-options "-O2 -ftree-vectorize -mssse3 -mtune=corei7" } */
> > +/* { dg-options "-O2 -fvect-cost-model=cheap -mssse3 -mtune=corei7" } */
> >  #define byte unsigned char
> >
> >  void
> > diff --git a/gcc/testsuite/gcc.target/i386/pr60451.c b/gcc/testsuite/gcc.target/i386/pr60451.c
> > index 2396ba81da1..c1bca753783 100644
> > --- a/gcc/testsuite/gcc.target/i386/pr60451.c
> > +++ b/gcc/testsuite/gcc.target/i386/pr60451.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do compile } */
> > -/* { dg-options "-O2 -ftree-vectorize -msse2" } */
> > +/* { dg-options "-O2 -fvect-cost-model=cheap -msse2" } */
> >
> >  void
> >  foo (unsigned char *a, unsigned char *b, unsigned char *c, int size)
> > diff --git a/gcc/testsuite/gcc.target/i386/pr61403.c b/gcc/testsuite/gcc.target/i386/pr61403.c
> > index 48c7ba68d78..b9165a4ed81 100644
> > --- a/gcc/testsuite/gcc.target/i386/pr61403.c
> > +++ b/gcc/testsuite/gcc.target/i386/pr61403.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do compile } */
> > -/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse4.2 -mtune=corei7" } */
> > +/* { dg-options "-O2 -ffast-math -fvect-cost-model=cheap -msse4.2 -mtune=corei7" } */
> >  /* { dg-require-effective-target c99_runtime } */
> >
> >  #include <math.h>
> > diff --git a/gcc/testsuite/gcc.target/i386/pr68483-1.c b/gcc/testsuite/gcc.target/i386/pr68483-1.c
> > index 29787e94bd3..493d6a9011a 100644
> > --- a/gcc/testsuite/gcc.target/i386/pr68483-1.c
> > +++ b/gcc/testsuite/gcc.target/i386/pr68483-1.c
> > @@ -1,6 +1,6 @@
> >  /* PR target/68483 */
> >  /* { dg-do compile } */
> > -/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse3" } */
> > +/* { dg-options "-O2 -fvect-cost-model=cheap -msse2 -mno-sse3" } */
> >
> >  void
> >  test (int *input, int *out, unsigned x1, unsigned x2)
> > diff --git a/gcc/testsuite/gcc.target/i386/pr82460-2.c b/gcc/testsuite/gcc.target/i386/pr82460-2.c
> > index 8cdfb54f56a..72076d490e2 100644
> > --- a/gcc/testsuite/gcc.target/i386/pr82460-2.c
> > +++ b/gcc/testsuite/gcc.target/i386/pr82460-2.c
> > @@ -1,6 +1,6 @@
> >  /* PR target/82460 */
> >  /* { dg-do compile } */
> > -/* { dg-options "-O2 -ftree-vectorize -mavx512vbmi -mprefer-vector-width=none --param=vect-epilogues-nomask=0" } */
> > +/* { dg-options "-O2 -fvect-cost-model=cheap -mavx512vbmi -mprefer-vector-width=none --param=vect-epilogues-nomask=0" } */
> >  /* We want to reuse the permutation mask in the loop, so use vpermt2b rather
> >     than vpermi2b.  */
> >  /* { dg-final { scan-assembler-not {\mvpermi2b\M} } } */
> > diff --git a/gcc/testsuite/gcc.target/i386/pr95798-1.c b/gcc/testsuite/gcc.target/i386/pr95798-1.c
> > index 9a7e32d6f2f..526f48921fd 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 c670d3780e8..6b5c5a73e96 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/gcc.target/i386/pr98365.c b/gcc/testsuite/gcc.target/i386/pr98365.c
> > index 652210dcdd5..6bb58d08fe5 100644
> > --- a/gcc/testsuite/gcc.target/i386/pr98365.c
> > +++ b/gcc/testsuite/gcc.target/i386/pr98365.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do compile } */
> > -/* { dg-options "-O2 -mavx2 -ftree-vectorize -fdump-tree-vect-details" } */
> > +/* { dg-options "-O2 -mavx2 -fvect-cost-model=cheap -fdump-tree-vect-details" } */
> >  /* { dg-final { scan-tree-dump-times "vectorized \[1-3] loops" 2 "vect" } } */
> >  short foo1 (short* a, short* c, int n)
> >  {
> > diff --git a/gcc/testsuite/gcc.target/i386/vect-abs-s16.c b/gcc/testsuite/gcc.target/i386/vect-abs-s16.c
> > index 266599f8ea2..b4c54129c39 100644
> > --- a/gcc/testsuite/gcc.target/i386/vect-abs-s16.c
> > +++ b/gcc/testsuite/gcc.target/i386/vect-abs-s16.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do compile } */
> > -/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse3 -fdump-tree-vect-details" } */
> > +/* { dg-options "-O2 -fvect-cost-model=cheap -msse2 -mno-sse3 -fdump-tree-vect-details" } */
> >
> >  int abs (int);
> >
> > diff --git a/gcc/testsuite/gcc.target/i386/vect-abs-s32.c b/gcc/testsuite/gcc.target/i386/vect-abs-s32.c
> > index 0a6bdac60f7..f14380556c4 100644
> > --- a/gcc/testsuite/gcc.target/i386/vect-abs-s32.c
> > +++ b/gcc/testsuite/gcc.target/i386/vect-abs-s32.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do compile } */
> > -/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse3 -fdump-tree-vect-details" } */
> > +/* { dg-options "-O2 -fvect-cost-model=cheap -msse2 -mno-sse3 -fdump-tree-vect-details" } */
> >
> >  int abs (int);
> >
> > diff --git a/gcc/testsuite/gcc.target/i386/vect-abs-s8.c b/gcc/testsuite/gcc.target/i386/vect-abs-s8.c
> > index d6e31976f40..7a965a0295a 100644
> > --- a/gcc/testsuite/gcc.target/i386/vect-abs-s8.c
> > +++ b/gcc/testsuite/gcc.target/i386/vect-abs-s8.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do compile } */
> > -/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse3 -fdump-tree-vect-details" } */
> > +/* { dg-options "-O2 -fvect-cost-model=cheap -msse2 -mno-sse3 -fdump-tree-vect-details" } */
> >
> >  int abs (int);
> >
> > diff --git a/gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c b/gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c
> > index 1b468e47754..08c30a35e70 100644
> > --- a/gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c
> > +++ b/gcc/testsuite/gcc.target/i386/vect-pack-trunc-1.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do run } */
> > -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> > +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
> >  /* { dg-require-effective-target avx512bw } */
> >
> >  #include "avx512bw-check.h"
> > diff --git a/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c b/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c
> > index 3503deaa9d9..ebb6f5c578e 100644
> > --- a/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c
> > +++ b/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do run } */
> > -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> > +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
> >  /* { dg-require-effective-target avx512bw } */
> >
> >  #include "avx512bw-check.h"
> > diff --git a/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c b/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c
> > index 3de4dfabeea..e8507f49b1d 100644
> > --- a/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c
> > +++ b/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do run } */
> > -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> > +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
> >  /* { dg-require-effective-target avx512bw } */
> >
> >  #include "avx512bw-check.h"
> > diff --git a/gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c b/gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c
> > index e32d40a1bac..37514f4737e 100644
> > --- a/gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c
> > +++ b/gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do run } */
> > -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> > +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
> >  /* { dg-require-effective-target avx512bw } */
> >
> >  #include "avx512bw-check.h"
> > diff --git a/gcc/testsuite/gcc.target/i386/vect-pr67800.c b/gcc/testsuite/gcc.target/i386/vect-pr67800.c
> > index 8bd308c83f6..31cd7970206 100644
> > --- a/gcc/testsuite/gcc.target/i386/vect-pr67800.c
> > +++ b/gcc/testsuite/gcc.target/i386/vect-pr67800.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do compile } */
> > -/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -msse4.2" } */
> > +/* { dg-options "-O2 -fvect-cost-model=cheap -fdump-tree-vect-details -msse4.2" } */
> >
> >  #define ubyte unsigned char
> >  #define byte char
> > diff --git a/gcc/testsuite/gcc.target/i386/vect-unpack-1.c b/gcc/testsuite/gcc.target/i386/vect-unpack-1.c
> > index 84521e313e5..f572e4c8085 100644
> > --- a/gcc/testsuite/gcc.target/i386/vect-unpack-1.c
> > +++ b/gcc/testsuite/gcc.target/i386/vect-unpack-1.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do run } */
> > -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> > +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
> >  /* { dg-require-effective-target avx512bw } */
> >
> >  #include "avx512bw-check.h"
> > diff --git a/gcc/testsuite/gcc.target/i386/vect-unpack-2.c b/gcc/testsuite/gcc.target/i386/vect-unpack-2.c
> > index 51c518e6111..7234afddd4c 100644
> > --- a/gcc/testsuite/gcc.target/i386/vect-unpack-2.c
> > +++ b/gcc/testsuite/gcc.target/i386/vect-unpack-2.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do run } */
> > -/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> > +/* { dg-options "-O2 -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
> >  /* { dg-require-effective-target avx512bw } */
> >
> >  #include "avx512bw-check.h"
> > diff --git a/gcc/testsuite/gcc.target/i386/vect-unpack-3.c b/gcc/testsuite/gcc.target/i386/vect-unpack-3.c
> > index eb8a93e9eea..08e9827afcc 100644
> > --- a/gcc/testsuite/gcc.target/i386/vect-unpack-3.c
> > +++ b/gcc/testsuite/gcc.target/i386/vect-unpack-3.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do run } */
> > -/* { dg-options "-O2 -fdump-tree-vect-details -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
> > +/* { dg-options "-O2 -fdump-tree-vect-details -fvect-cost-model=cheap -ffast-math -mavx512bw -save-temps" } */
> >  /* { dg-require-effective-target avx512bw } */
> >
> >  #include "avx512bw-check.h"
> > diff --git a/gcc/testsuite/gfortran.dg/pr77498.f b/gcc/testsuite/gfortran.dg/pr77498.f
> > index f957b57bb00..a0fc8275a84 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
> > --
> > 2.27.0
> >



-- 
BR,
Hongtao

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-06  9:41   ` Jakub Jelinek
@ 2021-09-06 10:58     ` Hongtao Liu
  2021-09-06 11:01       ` Jakub Jelinek
  2021-09-06 11:05     ` Richard Biener
  1 sibling, 1 reply; 39+ messages in thread
From: Hongtao Liu @ 2021-09-06 10:58 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Richard Biener, liuhongt, GCC Patches

On Mon, Sep 6, 2021 at 5:42 PM Jakub Jelinek via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Mon, Sep 06, 2021 at 11:18:47AM +0200, Richard Biener wrote:
> > On Mon, Sep 6, 2021 at 10:47 AM liuhongt via Gcc-patches
> > <gcc-patches@gcc.gnu.org> wrote:
> > >
> > > Hi:
> > >   As discussed in [1], most of (currently unopposed) targets want
> > > auto-vectorization at O2, and IMHO now would be a good time to enable O2
> > > vectorization for GCC trunk, so it would leave enough time to expose
> > > related issues and fix them.
> > >
> > >   Bootstrapped and regtested on x86_64-linux-gnu{-m32,}
> > >   Ok for trunk?
> >
> > It changes the cost model used when the user specifices
> > -O2 -ftree-vectorize which used 'cheap' before but now sticks to
> > 'very-cheap'.  I guess adjusting the cost model in process_options
> > might be possible when any(?) of the vectorizer flags were set
> > explicitly?
>
> process_options would mean it affects only the command line and not
> __attribute__((optimize ("O2", "ftree-vectorize")))
> etc.
> So, shouldn't it be instead done in default_options_optimization, somewhere
It seems default_options_optimization is before read_comline_options
which means it can't handle cmdline option -O2 -ftree-vectorize.

  default_options_optimization (opts, opts_set,
                                decoded_options, decoded_options_count,
                                loc, lang_mask, &handlers, dc);

  read_cmdline_options (opts, opts_set,
                        decoded_options, decoded_options_count,
                        loc, lang_mask,
                        &handlers, dc);


> among the
>   if (openacc_mode)
>     SET_OPTION_IF_UNSET (opts, opts_set, flag_ipa_pta, true);
>
>   /* Track fields in field-sensitive alias analysis.  */
>   if (opt2)
>     SET_OPTION_IF_UNSET (opts, opts_set, param_max_fields_for_field_sensitive,
>                          100);
>
>   if (opts->x_optimize_size)
>     /* We want to crossjump as much as possible.  */
>     SET_OPTION_IF_UNSET (opts, opts_set, param_min_crossjump_insns, 1);
>
>   /* Restrict the amount of work combine does at -Og while retaining
>      most of its useful transforms.  */
>   if (opts->x_optimize_debug)
>     SET_OPTION_IF_UNSET (opts, opts_set, param_max_combine_insns, 2);
> in there?
> Like:
>   /* 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_ftree_loop_vectorize
>           || opts_set->x_ftree_slp_vectorize))
>     SET_OPTION_IF_UNSET (opts, opts_set, fvect_cost_model_,
>                          VECT_COST_MODEL_CHEAP);
> Though, unsure if that will work with -O2 -ftree-vectorize which is an
> option without flag with EnabledBy on the other two options.
>
> Also, is:
> +    { OPT_LEVELS_2_PLUS, OPT_ftree_loop_vectorize, NULL, 1 },
> +    { OPT_LEVELS_2_PLUS, OPT_ftree_slp_vectorize, NULL, 1 },
> what we really want, isn't that instead:
> +    { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_ftree_loop_vectorize, NULL, 1 },
> +    { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_ftree_slp_vectorize, NULL, 1 },
> ?  I mean, for -Os vectorization even in very-cheap model I'd think it
> usually enlarges code size, and for -Og it is seriously harmful for
> debugging experience, especially when DWARF <= 5 doesn't have anything that
> would help debugging vectorized loops.
>
>         Jakub
>


--
BR,
Hongtao

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-06 10:58     ` Hongtao Liu
@ 2021-09-06 11:01       ` Jakub Jelinek
  2021-09-06 11:15         ` Hongtao Liu
  0 siblings, 1 reply; 39+ messages in thread
From: Jakub Jelinek @ 2021-09-06 11:01 UTC (permalink / raw)
  To: Hongtao Liu; +Cc: Richard Biener, liuhongt, GCC Patches

On Mon, Sep 06, 2021 at 06:58:37PM +0800, Hongtao Liu wrote:
> > process_options would mean it affects only the command line and not
> > __attribute__((optimize ("O2", "ftree-vectorize")))
> > etc.
> > So, shouldn't it be instead done in default_options_optimization, somewhere
> It seems default_options_optimization is before read_comline_options
> which means it can't handle cmdline option -O2 -ftree-vectorize.
> 
>   default_options_optimization (opts, opts_set,
>                                 decoded_options, decoded_options_count,
>                                 loc, lang_mask, &handlers, dc);
> 
>   read_cmdline_options (opts, opts_set,
>                         decoded_options, decoded_options_count,
>                         loc, lang_mask,
>                         &handlers, dc);

So what about finish_options then?
default_options_optimization has only a single caller that then calls
read_cmdline_options and then finish_options.

	Jakub


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-06  9:41   ` Jakub Jelinek
  2021-09-06 10:58     ` Hongtao Liu
@ 2021-09-06 11:05     ` Richard Biener
  1 sibling, 0 replies; 39+ messages in thread
From: Richard Biener @ 2021-09-06 11:05 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: liuhongt, GCC Patches

On Mon, Sep 6, 2021 at 11:41 AM Jakub Jelinek <jakub@redhat.com> wrote:
>
> On Mon, Sep 06, 2021 at 11:18:47AM +0200, Richard Biener wrote:
> > On Mon, Sep 6, 2021 at 10:47 AM liuhongt via Gcc-patches
> > <gcc-patches@gcc.gnu.org> wrote:
> > >
> > > Hi:
> > >   As discussed in [1], most of (currently unopposed) targets want
> > > auto-vectorization at O2, and IMHO now would be a good time to enable O2
> > > vectorization for GCC trunk, so it would leave enough time to expose
> > > related issues and fix them.
> > >
> > >   Bootstrapped and regtested on x86_64-linux-gnu{-m32,}
> > >   Ok for trunk?
> >
> > It changes the cost model used when the user specifices
> > -O2 -ftree-vectorize which used 'cheap' before but now sticks to
> > 'very-cheap'.  I guess adjusting the cost model in process_options
> > might be possible when any(?) of the vectorizer flags were set
> > explicitly?
>
> process_options would mean it affects only the command line and not
> __attribute__((optimize ("O2", "ftree-vectorize")))
> etc.
> So, shouldn't it be instead done in default_options_optimization, somewhere
> among the
>   if (openacc_mode)
>     SET_OPTION_IF_UNSET (opts, opts_set, flag_ipa_pta, true);
>
>   /* Track fields in field-sensitive alias analysis.  */
>   if (opt2)
>     SET_OPTION_IF_UNSET (opts, opts_set, param_max_fields_for_field_sensitive,
>                          100);
>
>   if (opts->x_optimize_size)
>     /* We want to crossjump as much as possible.  */
>     SET_OPTION_IF_UNSET (opts, opts_set, param_min_crossjump_insns, 1);
>
>   /* Restrict the amount of work combine does at -Og while retaining
>      most of its useful transforms.  */
>   if (opts->x_optimize_debug)
>     SET_OPTION_IF_UNSET (opts, opts_set, param_max_combine_insns, 2);
> in there?
> Like:
>   /* 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_ftree_loop_vectorize
>           || opts_set->x_ftree_slp_vectorize))
>     SET_OPTION_IF_UNSET (opts, opts_set, fvect_cost_model_,
>                          VECT_COST_MODEL_CHEAP);
> Though, unsure if that will work with -O2 -ftree-vectorize which is an
> option without flag with EnabledBy on the other two options.

One needs to check that, yes.

>
> Also, is:
> +    { OPT_LEVELS_2_PLUS, OPT_ftree_loop_vectorize, NULL, 1 },
> +    { OPT_LEVELS_2_PLUS, OPT_ftree_slp_vectorize, NULL, 1 },
> what we really want, isn't that instead:
> +    { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_ftree_loop_vectorize, NULL, 1 },
> +    { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_ftree_slp_vectorize, NULL, 1 },
> ?  I mean, for -Os vectorization even in very-cheap model I'd think it
> usually enlarges code size, and for -Og it is seriously harmful for
> debugging experience, especially when DWARF <= 5 doesn't have anything that
> would help debugging vectorized loops.

I guess technically SLP vectorize would be fine for -Os, at least on archs with
fixed size instruction lengths.  I'm unsure whether the vectorizer cost model is
good at tracking size though.

-Og is optimize == 1

Now the issue is what we'd do for -O2 -ftree-slp-vectorize, do we want the
very-cheap model for loop vectorization but cheap for SLP vectorization?
I think the cost model differences (besides disabling) only make a difference
for loop vectorization so it should probably be testing
opts_set->x_ftree_loop_vectorize
only and thus explicit/implicit enabling of loop vectorization should make the
difference.  (but yes, double-check how -ftree-vectorize arrives here)

Richard.

>
>         Jakub
>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-06 11:15         ` Hongtao Liu
@ 2021-09-06 11:15           ` Jakub Jelinek
  2021-09-06 12:18             ` Richard Biener
  0 siblings, 1 reply; 39+ messages in thread
From: Jakub Jelinek @ 2021-09-06 11:15 UTC (permalink / raw)
  To: Hongtao Liu; +Cc: Richard Biener, liuhongt, GCC Patches

On Mon, Sep 06, 2021 at 07:15:41PM +0800, Hongtao Liu wrote:
> > So what about finish_options then?
> > default_options_optimization has only a single caller that then calls
> > read_cmdline_options and then finish_options.
> in finish_options
> (gdb) p opts_set->x_flag_tree_loop_vectorize
> $37 = 1
> with -O2 -ftree-loop-vectorize,
> 
> but
> 1000   if (opts->x_dump_base_name
> (gdb) p opts_set->x_flag_tree_loop_vectorize
> $38 = 0
> for -O2 -ftree-vectorize???
> 
> Any magic  for ftree-vectorize w/ EnabledBy???

I guess a way to get this working would be:
 ; 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.

and then you can test both
opts_set->x_flag_tree_vectorize
and
opts_set->x_flag_tree_loop_vectorize

	Jakub


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-06 11:01       ` Jakub Jelinek
@ 2021-09-06 11:15         ` Hongtao Liu
  2021-09-06 11:15           ` Jakub Jelinek
  0 siblings, 1 reply; 39+ messages in thread
From: Hongtao Liu @ 2021-09-06 11:15 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Richard Biener, liuhongt, GCC Patches

On Mon, Sep 6, 2021 at 7:01 PM Jakub Jelinek <jakub@redhat.com> wrote:
>
> On Mon, Sep 06, 2021 at 06:58:37PM +0800, Hongtao Liu wrote:
> > > process_options would mean it affects only the command line and not
> > > __attribute__((optimize ("O2", "ftree-vectorize")))
> > > etc.
> > > So, shouldn't it be instead done in default_options_optimization, somewhere
> > It seems default_options_optimization is before read_comline_options
> > which means it can't handle cmdline option -O2 -ftree-vectorize.
> >
> >   default_options_optimization (opts, opts_set,
> >                                 decoded_options, decoded_options_count,
> >                                 loc, lang_mask, &handlers, dc);
> >
> >   read_cmdline_options (opts, opts_set,
> >                         decoded_options, decoded_options_count,
> >                         loc, lang_mask,
> >                         &handlers, dc);
>
> So what about finish_options then?
> default_options_optimization has only a single caller that then calls
> read_cmdline_options and then finish_options.
in finish_options
(gdb) p opts_set->x_flag_tree_loop_vectorize
$37 = 1
with -O2 -ftree-loop-vectorize,

but
1000   if (opts->x_dump_base_name
(gdb) p opts_set->x_flag_tree_loop_vectorize
$38 = 0
for -O2 -ftree-vectorize???

Any magic  for ftree-vectorize w/ EnabledBy???

>
>         Jakub
>


-- 
BR,
Hongtao

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-06 11:15           ` Jakub Jelinek
@ 2021-09-06 12:18             ` Richard Biener
  2021-09-06 12:30               ` Jakub Jelinek
  0 siblings, 1 reply; 39+ messages in thread
From: Richard Biener @ 2021-09-06 12:18 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Hongtao Liu, liuhongt, GCC Patches

On Mon, Sep 6, 2021 at 1:15 PM Jakub Jelinek <jakub@redhat.com> wrote:
>
> On Mon, Sep 06, 2021 at 07:15:41PM +0800, Hongtao Liu wrote:
> > > So what about finish_options then?
> > > default_options_optimization has only a single caller that then calls
> > > read_cmdline_options and then finish_options.
> > in finish_options
> > (gdb) p opts_set->x_flag_tree_loop_vectorize
> > $37 = 1
> > with -O2 -ftree-loop-vectorize,
> >
> > but
> > 1000   if (opts->x_dump_base_name
> > (gdb) p opts_set->x_flag_tree_loop_vectorize
> > $38 = 0
> > for -O2 -ftree-vectorize???
> >
> > Any magic  for ftree-vectorize w/ EnabledBy???
>
> I guess a way to get this working would be:
>  ; 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.
>
> and then you can test both
> opts_set->x_flag_tree_vectorize
> and
> opts_set->x_flag_tree_loop_vectorize

Or make EnabledBy have set opts_set-> as well.

Richard.

>         Jakub
>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-06 12:18             ` Richard Biener
@ 2021-09-06 12:30               ` Jakub Jelinek
  2021-09-06 12:43                 ` Richard Biener
  0 siblings, 1 reply; 39+ messages in thread
From: Jakub Jelinek @ 2021-09-06 12:30 UTC (permalink / raw)
  To: Richard Biener, Joseph S. Myers; +Cc: Hongtao Liu, liuhongt, GCC Patches

On Mon, Sep 06, 2021 at 02:18:59PM +0200, Richard Biener wrote:
> On Mon, Sep 6, 2021 at 1:15 PM Jakub Jelinek <jakub@redhat.com> wrote:
> >
> > On Mon, Sep 06, 2021 at 07:15:41PM +0800, Hongtao Liu wrote:
> > > > So what about finish_options then?
> > > > default_options_optimization has only a single caller that then calls
> > > > read_cmdline_options and then finish_options.
> > > in finish_options
> > > (gdb) p opts_set->x_flag_tree_loop_vectorize
> > > $37 = 1
> > > with -O2 -ftree-loop-vectorize,
> > >
> > > but
> > > 1000   if (opts->x_dump_base_name
> > > (gdb) p opts_set->x_flag_tree_loop_vectorize
> > > $38 = 0
> > > for -O2 -ftree-vectorize???
> > >
> > > Any magic  for ftree-vectorize w/ EnabledBy???
> >
> > I guess a way to get this working would be:
> >  ; 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.
> >
> > and then you can test both
> > opts_set->x_flag_tree_vectorize
> > and
> > opts_set->x_flag_tree_loop_vectorize
> 
> Or make EnabledBy have set opts_set-> as well.

That would change a little bit what *_set->x_* means.

If user has explicit -O2, we have *_set->x_optimize set,
but don't enable it on all the suboptions that are implicitly
enabled because explicit -O2 has been used.
And isn't EnabledBy practically the same?  If user writes
-Wall explicitly which implicitly enables hundreds of warning
options, do we want just Wall or also all the other options
marked as explicit?  E.g. backend code than can't easily differentiate
between -Wwhatever and -Wall implying -Wwhatever and e.g. changing that
if implicit only.

	Jakub


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-06 12:30               ` Jakub Jelinek
@ 2021-09-06 12:43                 ` Richard Biener
  0 siblings, 0 replies; 39+ messages in thread
From: Richard Biener @ 2021-09-06 12:43 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Joseph S. Myers, Hongtao Liu, liuhongt, GCC Patches

On Mon, Sep 6, 2021 at 2:30 PM Jakub Jelinek <jakub@redhat.com> wrote:
>
> On Mon, Sep 06, 2021 at 02:18:59PM +0200, Richard Biener wrote:
> > On Mon, Sep 6, 2021 at 1:15 PM Jakub Jelinek <jakub@redhat.com> wrote:
> > >
> > > On Mon, Sep 06, 2021 at 07:15:41PM +0800, Hongtao Liu wrote:
> > > > > So what about finish_options then?
> > > > > default_options_optimization has only a single caller that then calls
> > > > > read_cmdline_options and then finish_options.
> > > > in finish_options
> > > > (gdb) p opts_set->x_flag_tree_loop_vectorize
> > > > $37 = 1
> > > > with -O2 -ftree-loop-vectorize,
> > > >
> > > > but
> > > > 1000   if (opts->x_dump_base_name
> > > > (gdb) p opts_set->x_flag_tree_loop_vectorize
> > > > $38 = 0
> > > > for -O2 -ftree-vectorize???
> > > >
> > > > Any magic  for ftree-vectorize w/ EnabledBy???
> > >
> > > I guess a way to get this working would be:
> > >  ; 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.
> > >
> > > and then you can test both
> > > opts_set->x_flag_tree_vectorize
> > > and
> > > opts_set->x_flag_tree_loop_vectorize
> >
> > Or make EnabledBy have set opts_set-> as well.
>
> That would change a little bit what *_set->x_* means.
>
> If user has explicit -O2, we have *_set->x_optimize set,
> but don't enable it on all the suboptions that are implicitly
> enabled because explicit -O2 has been used.
> And isn't EnabledBy practically the same?  If user writes
> -Wall explicitly which implicitly enables hundreds of warning
> options, do we want just Wall or also all the other options
> marked as explicit?  E.g. backend code than can't easily differentiate
> between -Wwhatever and -Wall implying -Wwhatever and e.g. changing that
> if implicit only.

Hmm, good point.

Richard.

>
>         Jakub
>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-06  8:46 [PATCH] Enable auto-vectorization at O2 with very-cheap cost model liuhongt
  2021-09-06  8:55 ` Hongtao Liu
  2021-09-06  9:18 ` Richard Biener
@ 2021-09-06 16:37 ` Joseph Myers
  2021-09-07  2:07   ` Hongtao Liu
  2 siblings, 1 reply; 39+ messages in thread
From: Joseph Myers @ 2021-09-06 16:37 UTC (permalink / raw)
  To: liuhongt; +Cc: gcc-patches, jakub

On Mon, 6 Sep 2021, liuhongt via Gcc-patches wrote:

> Hi:
>   As discussed in [1], most of (currently unopposed) targets want
> auto-vectorization at O2, and IMHO now would be a good time to enable O2
> vectorization for GCC trunk, so it would leave enough time to expose
> related issues and fix them.
> 
>   Bootstrapped and regtested on x86_64-linux-gnu{-m32,}
>   Ok for trunk?

This needs updates to the documentation of -O2 and -ftree-vectorize in 
invoke.texi.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-06 16:37 ` Joseph Myers
@ 2021-09-07  2:07   ` Hongtao Liu
  0 siblings, 0 replies; 39+ messages in thread
From: Hongtao Liu @ 2021-09-07  2:07 UTC (permalink / raw)
  To: Joseph Myers; +Cc: liuhongt, Jakub Jelinek, GCC Patches

[-- Attachment #1: Type: text/plain, Size: 831 bytes --]

On Tue, Sep 7, 2021 at 12:37 AM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Mon, 6 Sep 2021, liuhongt via Gcc-patches wrote:
>
> > Hi:
> >   As discussed in [1], most of (currently unopposed) targets want
> > auto-vectorization at O2, and IMHO now would be a good time to enable O2
> > vectorization for GCC trunk, so it would leave enough time to expose
> > related issues and fix them.
> >
> >   Bootstrapped and regtested on x86_64-linux-gnu{-m32,}
> >   Ok for trunk?
>
> This needs updates to the documentation of -O2 and -ftree-vectorize in
> invoke.texi.

Updated patch.
  - Update document for @item -O2 and @item -O3
  - Use cheap cost model for explicit -ftree{,-loop}-vectorize.
  - Enable O2 vectorization at OPT_LEVELS_2_PLUS_SPEED_ONLY,

>
> --
> Joseph S. Myers
> joseph@codesourcery.com



-- 
BR,
Hongtao

[-- Attachment #2: v2-0001-Enable-auto-vectorization-at-O2-with-very-cheap-c.patch --]
[-- Type: text/x-patch, Size: 38956 bytes --]

From 1b343dd8e6b31dfc953ff002728e249a2a5ea29f Mon Sep 17 00:00:00 2001
From: liuhongt <hongtao.liu@intel.com>
Date: Mon, 6 Sep 2021 13:48:49 +0800
Subject: [PATCH v2] Enable auto-vectorization at O2 with very-cheap cost
 model.

gcc/ChangeLog:

	* common.opt (ftree-vectorize): Add Var(flag_tree_vectorize).
	* doc/invoke.texi (Options That Control Optimization): Update
	documents.
	* opts.c (default_options_table): Enable auto-vectorization at
	O2 with very-cheap cost model.
	(finish_options): Use cheap cost model for
	explicit -ftree{,-loop}-vectorize.

gcc/testsuite/ChangeLog:

	* c-c++-common/Wstringop-overflow-2.c: Adjust testcase.
	* g++.dg/tree-ssa/pr81408.C: Ditto.
	* g++.dg/warn/Wuninitialized-13.C: Ditto.
	* gcc.dg/Warray-bounds-51.c: Ditto.
	* gcc.dg/Warray-parameter-3.c: Ditto.
	* gcc.dg/Wstringop-overflow-13.c: Ditto.
	* gcc.dg/Wstringop-overflow-14.c: Ditto.
	* gcc.dg/Wstringop-overflow-21.c: Ditto.
	* gcc.dg/Wstringop-overflow-68.c: Ditto.
	* gcc.dg/gomp/pr46032-2.c: Ditto.
	* gcc.dg/gomp/pr46032-3.c: Ditto.
	* gcc.dg/gomp/simd-2.c: Ditto.
	* gcc.dg/gomp/simd-3.c: Ditto.
	* gcc.dg/graphite/fuse-1.c: Ditto.
	* gcc.dg/pr67089-6.c: Ditto.
	* gcc.dg/pr82929-2.c: Ditto.
	* gcc.dg/pr82929.c: Ditto.
	* gcc.dg/store_merging_1.c: Ditto.
	* gcc.dg/store_merging_11.c: Ditto.
	* gcc.dg/store_merging_15.c: Ditto.
	* gcc.dg/store_merging_16.c: Ditto.
	* gcc.dg/store_merging_19.c: Ditto.
	* gcc.dg/store_merging_24.c: Ditto.
	* gcc.dg/store_merging_25.c: Ditto.
	* gcc.dg/store_merging_28.c: Ditto.
	* gcc.dg/store_merging_30.c: Ditto.
	* gcc.dg/store_merging_5.c: Ditto.
	* gcc.dg/store_merging_7.c: Ditto.
	* gcc.dg/store_merging_8.c: Ditto.
	* gcc.dg/strlenopt-85.c: Ditto.
	* gcc.dg/tree-ssa/dump-6.c: Ditto.
	* gcc.dg/tree-ssa/pr19210-1.c: Ditto.
	* gcc.dg/tree-ssa/pr47059.c: Ditto.
	* gcc.dg/tree-ssa/pr86017.c: Ditto.
	* gcc.dg/tree-ssa/pr91482.c: Ditto.
	* gcc.dg/tree-ssa/predcom-1.c: Ditto.
	* gcc.dg/tree-ssa/predcom-dse-3.c: Ditto.
	* gcc.dg/tree-ssa/prefetch-3.c: Ditto.
	* gcc.dg/tree-ssa/prefetch-6.c: Ditto.
	* gcc.dg/tree-ssa/prefetch-8.c: Ditto.
	* gcc.dg/tree-ssa/prefetch-9.c: Ditto.
	* gcc.dg/tree-ssa/ssa-dse-18.c: Ditto.
	* gcc.dg/tree-ssa/ssa-dse-19.c: Ditto.
	* gcc.dg/uninit-40.c: Ditto.
	* gcc.dg/unroll-7.c: Ditto.
	* gcc.misc-tests/help.exp: Ditto.
	* gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
	* gcc.target/i386/pr22141.c: Ditto.
	* gcc.target/i386/pr34012.c: Ditto.
	* gcc.target/i386/pr49781-1.c: Ditto.
	* gcc.target/i386/pr95798-1.c: Ditto.
	* gcc.target/i386/pr95798-2.c: Ditto.
	* gfortran.dg/pr77498.f: Ditto.
---
 gcc/common.opt                                  |  2 +-
 gcc/doc/invoke.texi                             |  8 +++++---
 gcc/opts.c                                      | 17 ++++++++++++++---
 .../c-c++-common/Wstringop-overflow-2.c         |  2 +-
 gcc/testsuite/g++.dg/tree-ssa/pr81408.C         |  2 +-
 gcc/testsuite/g++.dg/warn/Wuninitialized-13.C   |  2 +-
 gcc/testsuite/gcc.dg/Warray-bounds-51.c         |  2 +-
 gcc/testsuite/gcc.dg/Warray-parameter-3.c       |  2 +-
 gcc/testsuite/gcc.dg/Wstringop-overflow-13.c    |  2 +-
 gcc/testsuite/gcc.dg/Wstringop-overflow-14.c    |  2 +-
 gcc/testsuite/gcc.dg/Wstringop-overflow-21.c    |  2 +-
 gcc/testsuite/gcc.dg/Wstringop-overflow-68.c    |  2 +-
 gcc/testsuite/gcc.dg/gomp/pr46032-2.c           |  2 +-
 gcc/testsuite/gcc.dg/gomp/pr46032-3.c           |  2 +-
 gcc/testsuite/gcc.dg/gomp/simd-2.c              |  2 +-
 gcc/testsuite/gcc.dg/gomp/simd-3.c              |  2 +-
 gcc/testsuite/gcc.dg/graphite/fuse-1.c          |  2 +-
 gcc/testsuite/gcc.dg/pr67089-6.c                |  2 +-
 gcc/testsuite/gcc.dg/pr82929-2.c                |  2 +-
 gcc/testsuite/gcc.dg/pr82929.c                  |  2 +-
 gcc/testsuite/gcc.dg/store_merging_1.c          |  2 +-
 gcc/testsuite/gcc.dg/store_merging_11.c         |  2 +-
 gcc/testsuite/gcc.dg/store_merging_15.c         |  2 +-
 gcc/testsuite/gcc.dg/store_merging_16.c         |  2 +-
 gcc/testsuite/gcc.dg/store_merging_19.c         |  2 +-
 gcc/testsuite/gcc.dg/store_merging_24.c         |  2 +-
 gcc/testsuite/gcc.dg/store_merging_25.c         |  2 +-
 gcc/testsuite/gcc.dg/store_merging_28.c         |  2 +-
 gcc/testsuite/gcc.dg/store_merging_30.c         |  2 +-
 gcc/testsuite/gcc.dg/store_merging_5.c          |  2 +-
 gcc/testsuite/gcc.dg/store_merging_7.c          |  2 +-
 gcc/testsuite/gcc.dg/store_merging_8.c          |  2 +-
 gcc/testsuite/gcc.dg/strlenopt-85.c             |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/dump-6.c          |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c       |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr47059.c         |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr86017.c         |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr91482.c         |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c       |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c   |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c      |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c      |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c      |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c      |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c      |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c      |  2 +-
 gcc/testsuite/gcc.dg/uninit-40.c                |  2 +-
 gcc/testsuite/gcc.dg/unroll-7.c                 |  2 +-
 gcc/testsuite/gcc.misc-tests/help.exp           |  2 +-
 .../i386/avx512vpopcntdqvl-vpopcntd-1.c         |  2 +-
 gcc/testsuite/gcc.target/i386/pr22141.c         |  2 +-
 gcc/testsuite/gcc.target/i386/pr34012.c         |  2 +-
 gcc/testsuite/gcc.target/i386/pr49781-1.c       |  2 +-
 gcc/testsuite/gcc.target/i386/pr95798-1.c       |  2 +-
 gcc/testsuite/gcc.target/i386/pr95798-2.c       |  2 +-
 gcc/testsuite/gfortran.dg/pr77498.f             |  2 +-
 56 files changed, 73 insertions(+), 60 deletions(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index 7d69ab5ef7c..6ccd0422da8 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -3028,7 +3028,7 @@ Perform variable tracking and also tag variables that are uninitialized.
 
 ; 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/doc/invoke.texi b/gcc/doc/invoke.texi
index 8969bac664d..58566b8a01c 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10370,9 +10370,13 @@ also turns on the following optimization flags:
 -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 @gol
+-fvect-cost-model=very-cheap}
 
 Please note the warning under @option{-fgcse} about
 invoking @option{-O2} on programs that use computed gotos.
@@ -10392,9 +10396,7 @@ by @option{-O2} and also turns on the following optimization flags:
 -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
diff --git a/gcc/opts.c b/gcc/opts.c
index e0501551ef5..c6ae0427cad 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -626,7 +626,7 @@ static const struct default_options default_options_table[] =
     { 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 },
 
@@ -638,6 +638,9 @@ static const struct default_options default_options_table[] =
     { 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 },
@@ -655,9 +658,7 @@ static const struct default_options default_options_table[] =
     { 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 },
@@ -1323,6 +1324,16 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
       = (opts->x_flag_unroll_loops
          || opts->x_flag_peel_loops
          || opts->x_optimize >= 3);
+
+  /* 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/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
index 1d79930cd58..9351f7e7a1a 100644
--- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
+++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
@@ -1,7 +1,7 @@
 /* PR middle-end/91458 - inconsistent warning for writing past the end
    of an array member
    { dg-do compile }
-   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
+   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
 
 void sink (void*);
 
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
index 39e32fd4bc9..bc14309480c 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 49ee878806a..60e8dd4f0e2 100644
--- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
+++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
@@ -1,6 +1,6 @@
 /* PR c/98597 - ICE in -Wuninitialized printing a MEM_REF
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
 
 struct shared_count {
   shared_count () { }
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-51.c b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
index 6028b11637c..8b81a0ccfa7 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
@@ -1,7 +1,7 @@
 /* PR middle-end/92333 - missing variable name referencing VLA in warnings
    PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
 
 void sink (void*);
 
diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-3.c b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
index cbf3e9339f5..fbef715aa99 100644
--- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
+++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
@@ -59,7 +59,7 @@ void fas1 (int[static 2]);    // { dg-warning "\\\[-Warray-parameter=" }
 
 /* Also verify that -Warray-bounds doesn't trigger for ordinary array
    parameters...  */
-#pragma GCC optimize "2"
+#pragma GCC optimize ("2,-fno-tree-vectorize")
 
 __attribute__ ((noipa)) void
 gca3 (char a[3])
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
index bd513151cea..a78242bf26e 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
@@ -3,7 +3,7 @@
    PR middle-end/89911 - ICE on a call with no arguments to strnlen
    declared with no prototype
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
index d6201b068b6..808bf87c386 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
@@ -2,7 +2,7 @@
    types than char are diagnosed.
    { dg-do compile }
    { dg-require-effective-target int32plus }
-   { dg-options "-O2 -Wall -Wno-array-bounds" } */
+   { dg-options "-O2 -fno-tree-vectorize -Wall -Wno-array-bounds" } */
 
 typedef __INT16_TYPE__  int16_t;
 typedef __INT32_TYPE__  int32_t;
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
index 3a27460220c..f418a17ca93 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
@@ -1,7 +1,7 @@
 /* PR middle-end/92312 - bogus -Wstringop-overflow storing into a trailing
    array backed by larger buffer
    { dg-do compile }
-   { dg-options "-O2 -Wall -Wno-array-bounds" } */
+   { dg-options "-O2 -Wall -Wno-array-bounds -fno-tree-vectorize" } */
 
 struct S0 { char a, b[0]; };
 
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
index 6bcba274541..7cc1012130c 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
@@ -2,7 +2,7 @@
    a larger scalar into a smaller array
    Verify overflow by aggregate stores.
    { dg-do compile }
-   { dg-options "-O2" } */
+   { dg-options "-O2 -fno-tree-vectorize" } */
 
 #define A(N) (A ## N)
 #define Ac1 (AC1){ 0 }
diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
index e110880bd8e..2e562618489 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 a4af7ec4a8a..da1ab487385 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 85acb980f10..f4912127b81 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 86fee858673..c75060c07ae 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 527b6e5c415..61289d312c2 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 db2ffdfeca4..b59d75b2318 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 3442f91af02..b886f1cce76 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 bb84f2b21a3..123e1919cec 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 4cc43dfd9e1..91ca925be0e 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 2ec2394afb9..60ed5cd8bf9 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_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
index acd7de571f8..13fcca4aa11 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 9545dcce3de..cd83f1c0fe5 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 0841bb4deee..0a2bbc4bfde 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 744fe60e8e0..5291bb9e986 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 cf182190e91..96611b5e57b 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 2d6cffc4694..fadb7fff993 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 694d560a621..baf94efe733 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 6e7c72510ff..b0cb0da78e0 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 c744ece6407..dbe000a463e 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 e710a544ff0..d719e0a2257 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 e049e0c30e0..2ba1ee05700 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 70659c00c0e..6c803908781 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 50d86a00485..b9e40e964c1 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 9f9c61aa213..860cde12c0f 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 f216e83c7b3..c7ef73ad59e 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 7d6a724e4ad..0ddad573129 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 f68be2b3379..8c3d9a4fc58 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 ec08d6c0318..1fc8f089345 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 467903bf3fc..46f0d0c2317 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 12f09016943..3fa71685ace 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 cbd6a80d345..00f41c3e4f4 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 da4847320b1..e8848c30acc 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 92b2df80ec8..2e7b5b496ea 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 718b7466e50..7bb8d060631 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 c015191ca32..8708079d397 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 055369bf8b1..695af5757cc 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 5e034d26947..eb6d8686c6a 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=target,optimizers" "" "" ""
 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 709cd21e671..a732bc466db 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/pr22141.c b/gcc/testsuite/gcc.target/i386/pr22141.c
index 036422e8ccf..b68b97f3f72 100644
--- a/gcc/testsuite/gcc.target/i386/pr22141.c
+++ b/gcc/testsuite/gcc.target/i386/pr22141.c
@@ -1,6 +1,6 @@
 /* PR middle-end/22141 */
 /* { dg-do compile } */
-/* { dg-options "-Os" } */
+/* { dg-options "-Os -fno-tree-vectorize" } */
 
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.target/i386/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
index d0cffa05290..1c1f0eea52e 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 60f9d50d866..d5a2e32db97 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 9a7e32d6f2f..526f48921fd 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 c670d3780e8..6b5c5a73e96 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 f957b57bb00..a0fc8275a84 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
-- 
2.27.0


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-10-08 10:49                 ` Aldy Hernandez
@ 2021-10-08 23:43                   ` Martin Sebor
  0 siblings, 0 replies; 39+ messages in thread
From: Martin Sebor @ 2021-10-08 23:43 UTC (permalink / raw)
  To: Aldy Hernandez, Richard Biener
  Cc: Jakub Jelinek, Florian Weimer, Segher Boessenkool,
	Richard Sandiford, Premachandra.Mallappa, GCC Patches,
	Bill Schmidt, liuhongt, Joseph Myers

On 10/8/21 4:49 AM, Aldy Hernandez via Gcc-patches wrote:
> On Thu, Sep 23, 2021 at 8:32 AM Richard Biener via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
>>
>> On Thu, 23 Sep 2021, Hongtao Liu wrote:
>>
>>> On Thu, Sep 23, 2021 at 9:48 AM Hongtao Liu <crazylht@gmail.com> wrote:
>>>>
>>>> On Wed, Sep 22, 2021 at 10:21 PM Martin Sebor <msebor@gmail.com> wrote:
>>>>>
>>>>> On 9/21/21 7:38 PM, Hongtao Liu wrote:
>>>>>> On Mon, Sep 20, 2021 at 4:13 AM Martin Sebor <msebor@gmail.com> wrote:
>>>>> ...
>>>>>>>>>> diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>>>>>>>>> index 1d79930cd58..9351f7e7a1a 100644
>>>>>>>>>> --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>>>>>>>>> +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>>>>>>>>> @@ -1,7 +1,7 @@
>>>>>>>>>>     /* PR middle-end/91458 - inconsistent warning for writing past the end
>>>>>>>>>>        of an array member
>>>>>>>>>>        { dg-do compile }
>>>>>>>>>> -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
>>>>>>>>>> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
>>>>>>>>>
>>>>>>>>> The testcase is large - what part requires this change?  Given the
>>>>>>>>> testcase was added for inconsistent warnings do they now become
>>>>>>>>> inconsistent again as we enable vectorization at -O2?
>>>>>>>>>
>>>>>>>>> That said, the testcase adjustments need some explaining - I suppose
>>>>>>>>> you didn't just slap -fno-tree-vectorize to all of those changing
>>>>>>>>> behavior?
>>>>>>>>>
>>>>>>>> void ga1_ (void)
>>>>>>>> {
>>>>>>>>      a1_.a[0] = 0;
>>>>>>>>      a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
>>>>>>>>      a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
>>>>>>>>
>>>>>>>>      struct A1 a;
>>>>>>>>      a.a[0] = 0;
>>>>>>>>      a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
>>>>>>>>      a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
>>>>>>>>      sink (&a);
>>>>>>>> }
>>>>>>>>
>>>>>>>> It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
>>>>>>>> there are 2 accesses, but after enabling vectorization, there's only
>>>>>>>> one access, so one warning is missing which causes the failure.
>>>>>
>>>>> With the stores vectorized, is the warning on the correct line or
>>>>> does it point to the first store, the one that's in bounds, as
>>>>> it does with -O3?  The latter would be a regression at -O2.
>>>> For the upper case, It points to the second store which is out of
>>>> bounds, the third store warning is missing.
>>>>>
>>>>>>>
>>>>>>> I would find it preferable to change the test code over disabling
>>>>>>> optimizations that are on by default.  My concern is that the test
>>>>>>> would no longer exercise the default behavior.  (The same goes for
>>>>>>> the -fno-ipa-icf option.)
>>>>>> Hmm, it's a middle-end test, for some backend, it may not do
>>>>>> vectorization(it depends on TARGET_VECTOR_MODE_SUPPORTED_P and
>>>>>> relative cost model).
>>>>>
>>>>> Yes, there are quite a few warning tests like that.  Their main
>>>>> purpose is to verify that in common GCC invocations (i.e., without
>>>>> any special options) warnings are a) issued when expected and b)
>>>>> not issued when not expected.  Otherwise, middle end warnings are
>>>>> known to have both false positives and false negatives in some
>>>>> invocations, depending on what optimizations are in effect.
>>>>> Indiscriminately disabling common optimizations for these large
>>>>> tests and invoking them under artificial conditions would
>>>>> compromise this goal and hide the problems.
>>>>>
>>>>> If enabling vectorization at -O2 causes regressions in the quality
>>>>> of diagnostics (as the test failure above indicates seems to be
>>>>> happening) we should investigate these and open bugs for them so
>>>>> they can be fixed.  We can then tweak the specific failing test
>>>>> cases to avoid the failures until they are fixed.
>>>> There are indeed cases of false positives and false negatives
>>>> .i.e.
>>>> // Verify warning for access to a definition with an initializer that
>>>> // initializes the one-element array member.
>>>> struct A1 a1i_1 = { 0, { 1 } };
>>>>
>>>> void ga1i_1 (void)
>>>> {
>>>>    a1i_1.a[0] = 0;
>>>>    a1i_1.a[1] = 1;               // { dg-warning "\\\[-Wstringop-overflow" }
>>>>    a1i_1.a[2] = 2;               // { dg-warning "\\\[-Wstringop-overflow" }
>>>>
>>>>    struct A1 a = { 0, { 1 } }; --- false positive here.
>>>>    a.a[0] = 1;
>>>>    a.a[1] = 2;                   // { dg-warning
>>>> "\\\[-Wstringop-overflow" } false negative here.
>>>>    a.a[2] = 3;                   // { dg-warning
>>>> "\\\[-Wstringop-overflow" } false negative here.
>>>>    sink (&a);
>>>> }
>>> Similar for
>>> * gcc.dg/Warray-bounds-51.c.
>>> * gcc.dg/Warray-parameter-3.c
>>> * gcc.dg/Wstringop-overflow-14.c
>>> * gcc.dg/Wstringop-overflow-21.c
>>>
>>> So there're 3 situations.
>>> 1. All accesses are out of bound, and after vectorization, there are
>>> some warnings missing.
>>> 2. Part of accesses are inbound, part of accesses are out of bound,
>>> and after vectorization, the warning goes from out of bound line to
>>> inbound line.
>>> 3. All access are out of bound, and after vectoriation, all warning
>>> are missing, and goes to a false-positive line.
>>
>> I remember some of the warning code explicitely excuses itself from
>> even trying to deal with vectorized loads/stores, that might need to
>> be revisited.  It would also be useful to verify whether the line
>> info on the vectorized loads/stores is sensible (if you dump with
>> -lineno you get stmts with line numbers).
>>
>> It is of course impossible to preserve the location of all original
>> scalar accesses exactly - it _might_ be possible to create a new
>> location range (not sure how they are exactly represented), but then
>> if we vectorize say
>>
>>    a[0] = b[0];
>>    a[1] = b[1];
>>
>> we'd somehow get a multi-line location range that covers unrelated
>> bits (the intermediate load or store).
>>
>> So currently the vectorizer simply chooses the location of one of
>> the scalar loads or stores for the vectorized access (and it might do
>> so quite randomly).
>>
>> Note I don't think it's feasible to not vectorize out-of-bound loads
>> or stores for the same reason that you'll say you can't do the
>> warnings all before vectorizing because the might expose themselves
>> only later.
>>
>> So we simply have to cope with the reality that GCC is optimizing and
>> that the later we perform analysis for warnings the more the original
>> code is mangled.  As we moved array-bound warnings before unrolling
>> so we should move this particular warning to before vectorization
>> [loop optimization].
> 
> Sorry I'm late to the party here...
> 
> Couldn't we run warnings earlier?

Yes, we could.

> 
> A while back, I converted the array bounds checker to the generic
> range_query API, so it could be used either with the vr_values object
> from the VRP pass, or with a ranger.  There's no reason it should be
> tied to VRP.  We could make it its own pass and move it somewhere more
> sensible.

The warning here (-Wstringop-overflow) comes from the strlen pass
which runs after vectorization which is why we lose the accurate
location for individual stores.  VRP runs before it, so
-Warray-bounds doesn't suffer from the same problem.

Running the strlen subset of -Wstringop-overflow earlier will avoid
the problem:
https://gcc.gnu.org/pipermail/gcc-patches/2021-September/580040.html

It shouldn't even be necessary to move it -- -Warray-bounds should
be enough.  I think the only difference is that -Wstringop-overflow
for plain char assignments respects subobject boundaries while
-Warray-bounds does not (for accesses of any type).  That's a hack
to avoid some false positives so if we can find some other way to
avoid those we can improve -Warray-bounds and get rid of
-Wstringop-overflow for direct char stores (the warning was
meant for built-in string functions but it has grown to encompass
direct stores as well).

That said, it is useful to distinguish out-of-bounds reads from
out-of-bounds writes.  -Wstringop-overflow and -Wstringop-overread
make that possible.  -Warray-bounds doesn't.  So maybe we also need
to enhance -Warry-bounds and add the corresponding modes.

Martin

> 
> Aldy
> 


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-23  6:30               ` Richard Biener
  2021-09-23 15:18                 ` Martin Sebor
@ 2021-10-08 10:49                 ` Aldy Hernandez
  2021-10-08 23:43                   ` Martin Sebor
  1 sibling, 1 reply; 39+ messages in thread
From: Aldy Hernandez @ 2021-10-08 10:49 UTC (permalink / raw)
  To: Richard Biener
  Cc: Hongtao Liu, Jakub Jelinek, Florian Weimer, Segher Boessenkool,
	Richard Sandiford, Premachandra.Mallappa, GCC Patches,
	Bill Schmidt, liuhongt, Joseph Myers

On Thu, Sep 23, 2021 at 8:32 AM Richard Biener via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Thu, 23 Sep 2021, Hongtao Liu wrote:
>
> > On Thu, Sep 23, 2021 at 9:48 AM Hongtao Liu <crazylht@gmail.com> wrote:
> > >
> > > On Wed, Sep 22, 2021 at 10:21 PM Martin Sebor <msebor@gmail.com> wrote:
> > > >
> > > > On 9/21/21 7:38 PM, Hongtao Liu wrote:
> > > > > On Mon, Sep 20, 2021 at 4:13 AM Martin Sebor <msebor@gmail.com> wrote:
> > > > ...
> > > > >>>>> diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > > >>>>> index 1d79930cd58..9351f7e7a1a 100644
> > > > >>>>> --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > > >>>>> +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > > >>>>> @@ -1,7 +1,7 @@
> > > > >>>>>    /* PR middle-end/91458 - inconsistent warning for writing past the end
> > > > >>>>>       of an array member
> > > > >>>>>       { dg-do compile }
> > > > >>>>> -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
> > > > >>>>> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
> > > > >>>>
> > > > >>>> The testcase is large - what part requires this change?  Given the
> > > > >>>> testcase was added for inconsistent warnings do they now become
> > > > >>>> inconsistent again as we enable vectorization at -O2?
> > > > >>>>
> > > > >>>> That said, the testcase adjustments need some explaining - I suppose
> > > > >>>> you didn't just slap -fno-tree-vectorize to all of those changing
> > > > >>>> behavior?
> > > > >>>>
> > > > >>> void ga1_ (void)
> > > > >>> {
> > > > >>>     a1_.a[0] = 0;
> > > > >>>     a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
> > > > >>>     a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
> > > > >>>
> > > > >>>     struct A1 a;
> > > > >>>     a.a[0] = 0;
> > > > >>>     a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
> > > > >>>     a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
> > > > >>>     sink (&a);
> > > > >>> }
> > > > >>>
> > > > >>> It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
> > > > >>> there are 2 accesses, but after enabling vectorization, there's only
> > > > >>> one access, so one warning is missing which causes the failure.
> > > >
> > > > With the stores vectorized, is the warning on the correct line or
> > > > does it point to the first store, the one that's in bounds, as
> > > > it does with -O3?  The latter would be a regression at -O2.
> > > For the upper case, It points to the second store which is out of
> > > bounds, the third store warning is missing.
> > > >
> > > > >>
> > > > >> I would find it preferable to change the test code over disabling
> > > > >> optimizations that are on by default.  My concern is that the test
> > > > >> would no longer exercise the default behavior.  (The same goes for
> > > > >> the -fno-ipa-icf option.)
> > > > > Hmm, it's a middle-end test, for some backend, it may not do
> > > > > vectorization(it depends on TARGET_VECTOR_MODE_SUPPORTED_P and
> > > > > relative cost model).
> > > >
> > > > Yes, there are quite a few warning tests like that.  Their main
> > > > purpose is to verify that in common GCC invocations (i.e., without
> > > > any special options) warnings are a) issued when expected and b)
> > > > not issued when not expected.  Otherwise, middle end warnings are
> > > > known to have both false positives and false negatives in some
> > > > invocations, depending on what optimizations are in effect.
> > > > Indiscriminately disabling common optimizations for these large
> > > > tests and invoking them under artificial conditions would
> > > > compromise this goal and hide the problems.
> > > >
> > > > If enabling vectorization at -O2 causes regressions in the quality
> > > > of diagnostics (as the test failure above indicates seems to be
> > > > happening) we should investigate these and open bugs for them so
> > > > they can be fixed.  We can then tweak the specific failing test
> > > > cases to avoid the failures until they are fixed.
> > > There are indeed cases of false positives and false negatives
> > > .i.e.
> > > // Verify warning for access to a definition with an initializer that
> > > // initializes the one-element array member.
> > > struct A1 a1i_1 = { 0, { 1 } };
> > >
> > > void ga1i_1 (void)
> > > {
> > >   a1i_1.a[0] = 0;
> > >   a1i_1.a[1] = 1;               // { dg-warning "\\\[-Wstringop-overflow" }
> > >   a1i_1.a[2] = 2;               // { dg-warning "\\\[-Wstringop-overflow" }
> > >
> > >   struct A1 a = { 0, { 1 } }; --- false positive here.
> > >   a.a[0] = 1;
> > >   a.a[1] = 2;                   // { dg-warning
> > > "\\\[-Wstringop-overflow" } false negative here.
> > >   a.a[2] = 3;                   // { dg-warning
> > > "\\\[-Wstringop-overflow" } false negative here.
> > >   sink (&a);
> > > }
> > Similar for
> > * gcc.dg/Warray-bounds-51.c.
> > * gcc.dg/Warray-parameter-3.c
> > * gcc.dg/Wstringop-overflow-14.c
> > * gcc.dg/Wstringop-overflow-21.c
> >
> > So there're 3 situations.
> > 1. All accesses are out of bound, and after vectorization, there are
> > some warnings missing.
> > 2. Part of accesses are inbound, part of accesses are out of bound,
> > and after vectorization, the warning goes from out of bound line to
> > inbound line.
> > 3. All access are out of bound, and after vectoriation, all warning
> > are missing, and goes to a false-positive line.
>
> I remember some of the warning code explicitely excuses itself from
> even trying to deal with vectorized loads/stores, that might need to
> be revisited.  It would also be useful to verify whether the line
> info on the vectorized loads/stores is sensible (if you dump with
> -lineno you get stmts with line numbers).
>
> It is of course impossible to preserve the location of all original
> scalar accesses exactly - it _might_ be possible to create a new
> location range (not sure how they are exactly represented), but then
> if we vectorize say
>
>   a[0] = b[0];
>   a[1] = b[1];
>
> we'd somehow get a multi-line location range that covers unrelated
> bits (the intermediate load or store).
>
> So currently the vectorizer simply chooses the location of one of
> the scalar loads or stores for the vectorized access (and it might do
> so quite randomly).
>
> Note I don't think it's feasible to not vectorize out-of-bound loads
> or stores for the same reason that you'll say you can't do the
> warnings all before vectorizing because the might expose themselves
> only later.
>
> So we simply have to cope with the reality that GCC is optimizing and
> that the later we perform analysis for warnings the more the original
> code is mangled.  As we moved array-bound warnings before unrolling
> so we should move this particular warning to before vectorization
> [loop optimization].

Sorry I'm late to the party here...

Couldn't we run warnings earlier?

A while back, I converted the array bounds checker to the generic
range_query API, so it could be used either with the vr_values object
from the VRP pass, or with a ranger.  There's no reason it should be
tied to VRP.  We could make it its own pass and move it somewhere more
sensible.

Aldy


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-10-07 15:36                           ` H.J. Lu
@ 2021-10-08  2:16                             ` Hongtao Liu
  0 siblings, 0 replies; 39+ messages in thread
From: Hongtao Liu @ 2021-10-08  2:16 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Martin Liška, Jakub Jelinek, Florian Weimer, Richard Biener,
	Segher Boessenkool, Richard Sandiford, Mallappa, Premachandra,
	GCC Patches, Bill Schmidt, liuhongt, Joseph S. Myers

On Thu, Oct 7, 2021 at 11:38 PM H.J. Lu via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Thu, Oct 7, 2021 at 8:35 AM Martin Liška <mliska@suse.cz> wrote:
> >
> > Hello.
> >
> > The patch is approved, are you planning committing the changes?
Committed.
> >
> > Thanks,
> > Martin
>
> Hongtao is on holiday.  He will be back later today.
>
> --
> H.J.



-- 
BR,
Hongtao

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-10-07 15:34                         ` Martin Liška
@ 2021-10-07 15:36                           ` H.J. Lu
  2021-10-08  2:16                             ` Hongtao Liu
  0 siblings, 1 reply; 39+ messages in thread
From: H.J. Lu @ 2021-10-07 15:36 UTC (permalink / raw)
  To: Martin Liška
  Cc: liuhongt, GCC Patches, Jakub Jelinek, Florian Weimer,
	Richard Biener, Segher Boessenkool, Richard Sandiford, Mallappa,
	Premachandra, Bill Schmidt, Joseph S. Myers

On Thu, Oct 7, 2021 at 8:35 AM Martin Liška <mliska@suse.cz> wrote:
>
> Hello.
>
> The patch is approved, are you planning committing the changes?
>
> Thanks,
> Martin

Hongtao is on holiday.  He will be back later today.

-- 
H.J.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-26  3:18                       ` liuhongt
  2021-09-28 11:18                         ` Richard Biener
@ 2021-10-07 15:34                         ` Martin Liška
  2021-10-07 15:36                           ` H.J. Lu
  1 sibling, 1 reply; 39+ messages in thread
From: Martin Liška @ 2021-10-07 15:34 UTC (permalink / raw)
  To: liuhongt, gcc-patches
  Cc: jakub, fweimer, rguenther, segher, richard.sandiford,
	Premachandra.Mallappa, wschmidt, joseph

Hello.

The patch is approved, are you planning committing the changes?

Thanks,
Martin

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-26  3:18                       ` liuhongt
@ 2021-09-28 11:18                         ` Richard Biener
  2021-10-07 15:34                         ` Martin Liška
  1 sibling, 0 replies; 39+ messages in thread
From: Richard Biener @ 2021-09-28 11:18 UTC (permalink / raw)
  To: liuhongt
  Cc: gcc-patches, jakub, fweimer, segher, richard.sandiford,
	Premachandra.Mallappa, wschmidt, joseph

On Sun, 26 Sep 2021, liuhongt wrote:

> Hi:
> > Please don't add the -fno- option to the warning tests.  As I said,
> > I would prefer to either suppress the vectorization for the failing
> > cases by tweaking the test code or xfail them.  That way future
> > regressions won't be masked by the option.  Once we've moved
> > the warning to a more suitable pass we'll add a new test to verify
> > it works as intended or remove the xfails.
> 
> Remove -fno-tree-vectorize from the warning tests, and add xfails to them.
> The warning information is mainly affected by vectorization of 4 or 2 char
> store. Some targets support both, some targets only support one of them,
> and some targets supported neither, which means the warning information
> would differ from targets to targets.
> I only added xfail { x86_64-*-* i?86-*-* }, other backends may need to
> re-adjust these xfail.
> 
>   Bootstrapped and regtested on x86_64-linux-gnu{-m32,}.

OK.

Thanks,
Richard.

> gcc/ChangeLog:
> 
> 	* common.opt (ftree-vectorize): Add Var(flag_tree_vectorize).
> 	* doc/invoke.texi (Options That Control Optimization): Update
> 	documents.
> 	* opts.c (default_options_table): Enable auto-vectorization at
> 	O2 with very-cheap cost model.
> 	(finish_options): Use cheap cost model for
> 	explicit -ftree{,-loop}-vectorize.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* c-c++-common/Wstringop-overflow-2.c: Adjust testcase.
> 	* g++.dg/tree-ssa/pr81408.C: Ditto.
> 	* g++.dg/warn/Wuninitialized-13.C: Ditto.
> 	* gcc.dg/Warray-bounds-51.c: Ditto.
> 	* gcc.dg/Warray-parameter-3.c: Ditto.
> 	* gcc.dg/Wstringop-overflow-14.c: Ditto.
> 	* gcc.dg/Wstringop-overflow-21.c: Ditto.
> 	* gcc.dg/Wstringop-overflow-68.c: Ditto.
> 	* gcc.dg/Wstringop-overflow-76.c: Ditto.
> 	* gcc.dg/gomp/pr46032-2.c: Ditto.
> 	* gcc.dg/gomp/pr46032-3.c: Ditto.
> 	* gcc.dg/gomp/simd-2.c: Ditto.
> 	* gcc.dg/gomp/simd-3.c: Ditto.
> 	* gcc.dg/graphite/fuse-1.c: Ditto.
> 	* gcc.dg/pr67089-6.c: Ditto.
> 	* gcc.dg/pr82929-2.c: Ditto.
> 	* gcc.dg/pr82929.c: Ditto.
> 	* gcc.dg/store_merging_1.c: Ditto.
> 	* gcc.dg/store_merging_11.c: Ditto.
> 	* gcc.dg/store_merging_15.c: Ditto.
> 	* gcc.dg/store_merging_16.c: Ditto.
> 	* gcc.dg/store_merging_19.c: Ditto.
> 	* gcc.dg/store_merging_24.c: Ditto.
> 	* gcc.dg/store_merging_25.c: Ditto.
> 	* gcc.dg/store_merging_28.c: Ditto.
> 	* gcc.dg/store_merging_30.c: Ditto.
> 	* gcc.dg/store_merging_5.c: Ditto.
> 	* gcc.dg/store_merging_7.c: Ditto.
> 	* gcc.dg/store_merging_8.c: Ditto.
> 	* gcc.dg/strlenopt-85.c: Ditto.
> 	* gcc.dg/tree-ssa/dump-6.c: Ditto.
> 	* gcc.dg/tree-ssa/pr19210-1.c: Ditto.
> 	* gcc.dg/tree-ssa/pr47059.c: Ditto.
> 	* gcc.dg/tree-ssa/pr86017.c: Ditto.
> 	* gcc.dg/tree-ssa/pr91482.c: Ditto.
> 	* gcc.dg/tree-ssa/predcom-1.c: Ditto.
> 	* gcc.dg/tree-ssa/predcom-dse-3.c: Ditto.
> 	* gcc.dg/tree-ssa/prefetch-3.c: Ditto.
> 	* gcc.dg/tree-ssa/prefetch-6.c: Ditto.
> 	* gcc.dg/tree-ssa/prefetch-8.c: Ditto.
> 	* gcc.dg/tree-ssa/prefetch-9.c: Ditto.
> 	* gcc.dg/tree-ssa/ssa-dse-18.c: Ditto.
> 	* gcc.dg/tree-ssa/ssa-dse-19.c: Ditto.
> 	* gcc.dg/uninit-40.c: Ditto.
> 	* gcc.dg/unroll-7.c: Ditto.
> 	* gcc.misc-tests/help.exp: Ditto.
> 	* gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
> 	* gcc.target/i386/pr34012.c: Ditto.
> 	* gcc.target/i386/pr49781-1.c: Ditto.
> 	* gcc.target/i386/pr95798-1.c: Ditto.
> 	* gcc.target/i386/pr95798-2.c: Ditto.
> 	* gfortran.dg/pr77498.f: Ditto.
> ---
>  gcc/common.opt                                |  2 +-
>  gcc/doc/invoke.texi                           |  8 ++++----
>  gcc/opts.c                                    | 17 +++++++++++++---
>  .../c-c++-common/Wstringop-overflow-2.c       | 20 +++++++++----------
>  gcc/testsuite/g++.dg/tree-ssa/pr81408.C       |  2 +-
>  gcc/testsuite/g++.dg/warn/Wuninitialized-13.C |  2 +-
>  gcc/testsuite/gcc.dg/Warray-bounds-51.c       |  2 +-
>  gcc/testsuite/gcc.dg/Warray-parameter-3.c     |  4 ++--
>  gcc/testsuite/gcc.dg/Wstringop-overflow-14.c  |  4 ++--
>  gcc/testsuite/gcc.dg/Wstringop-overflow-21.c  |  8 ++++----
>  gcc/testsuite/gcc.dg/Wstringop-overflow-68.c  | 10 +++++-----
>  gcc/testsuite/gcc.dg/Wstringop-overflow-76.c  | 20 +++++++++----------
>  gcc/testsuite/gcc.dg/gomp/pr46032-2.c         |  2 +-
>  gcc/testsuite/gcc.dg/gomp/pr46032-3.c         |  2 +-
>  gcc/testsuite/gcc.dg/gomp/simd-2.c            |  2 +-
>  gcc/testsuite/gcc.dg/gomp/simd-3.c            |  2 +-
>  gcc/testsuite/gcc.dg/graphite/fuse-1.c        |  2 +-
>  gcc/testsuite/gcc.dg/pr67089-6.c              |  2 +-
>  gcc/testsuite/gcc.dg/pr82929-2.c              |  2 +-
>  gcc/testsuite/gcc.dg/pr82929.c                |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_1.c        |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_11.c       |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_15.c       |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_16.c       |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_19.c       |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_24.c       |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_25.c       |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_28.c       |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_30.c       |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_5.c        |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_7.c        |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_8.c        |  2 +-
>  gcc/testsuite/gcc.dg/strlenopt-85.c           |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/dump-6.c        |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c     |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/pr47059.c       |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/pr86017.c       |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/pr91482.c       |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c     |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c    |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c    |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c    |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c    |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c    |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c    |  2 +-
>  gcc/testsuite/gcc.dg/uninit-40.c              |  2 +-
>  gcc/testsuite/gcc.dg/unroll-7.c               |  2 +-
>  gcc/testsuite/gcc.misc-tests/help.exp         |  2 +-
>  .../i386/avx512vpopcntdqvl-vpopcntd-1.c       |  2 +-
>  gcc/testsuite/gcc.target/i386/pr34012.c       |  2 +-
>  gcc/testsuite/gcc.target/i386/pr49781-1.c     |  2 +-
>  gcc/testsuite/gcc.target/i386/pr95798-1.c     |  2 +-
>  gcc/testsuite/gcc.target/i386/pr95798-2.c     |  2 +-
>  gcc/testsuite/gfortran.dg/pr77498.f           |  2 +-
>  55 files changed, 98 insertions(+), 87 deletions(-)
> 
> diff --git a/gcc/common.opt b/gcc/common.opt
> index b921f5e3b25..4f2c0294c29 100644
> --- a/gcc/common.opt
> +++ b/gcc/common.opt
> @@ -3031,7 +3031,7 @@ Perform variable tracking and also tag variables that are uninitialized.
>  
>  ; 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/doc/invoke.texi b/gcc/doc/invoke.texi
> index ba98eab68a5..bde74389107 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -10411,9 +10411,12 @@ also turns on the following optimization flags:
>  -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.
> @@ -10433,11 +10436,8 @@ by @option{-O2} and also turns on the following optimization flags:
>  -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/opts.c b/gcc/opts.c
> index 1d2d22d7a3f..17765462316 100644
> --- a/gcc/opts.c
> +++ b/gcc/opts.c
> @@ -634,7 +634,8 @@ static const struct default_options default_options_table[] =
>      { 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 @@ static const struct default_options default_options_table[] =
>      { 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 @@ static const struct default_options default_options_table[] =
>      { 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 },
> @@ -1331,6 +1332,16 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
>        = (opts->x_flag_unroll_loops
>           || opts->x_flag_peel_loops
>           || opts->x_optimize >= 3);
> +
> +  /* 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/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> index 1d79930cd58..7e9da8a02cb 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 @@ void ga1__ (void)
>    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 @@ void ga1_0_ (void)
>    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 @@ void ga1_1 (void)
>    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 @@ void ga1i__ (void)
>    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 @@ void ga1i_0_ (void)
>    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 @@ void ga1i_1 (void)
>    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 39e32fd4bc9..bc14309480c 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 49ee878806a..210e74c3c3b 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 6028b11637c..b0b8bdb7938 100644
> --- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> +++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> @@ -38,7 +38,7 @@ void test_struct_char_vla_location (void)
>    } 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 cbf3e9339f5..e2c47e1ed36 100644
> --- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> +++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> @@ -59,7 +59,7 @@ void fas1 (int[static 2]);    // { dg-warning "\\\[-Warray-parameter=" }
>  
>  /* 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 @@ gia3 (int a[3])
>  __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 d6201b068b6..b648f5b41b1 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_memcpy_cond (int i)
>  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 3a27460220c..e88f7b47894 100644
> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> @@ -23,10 +23,10 @@ void test_store_zero_length (int i)
>  {
>    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 @@ void test_store_flexarray (int i)
>  {
>    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 6bcba274541..09df0004991 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_zero (void)
>  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 18191a1aa5e..30b1c9af2e8 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 @@ void max_a3_a5 (int i)
>       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 @@ void max_b6_b4 (int i)
>    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 @@ void max_d8_p (char *q, int i)
>  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 @@ void max_A3_A5 (int i, struct A3_5 *pa3_5)
>    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 @@ void max_B6_B4 (int i, struct B4_B6 *pb4_b6)
>    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 e110880bd8e..2e562618489 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 a4af7ec4a8a..da1ab487385 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 85acb980f10..f4912127b81 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 86fee858673..c75060c07ae 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 527b6e5c415..61289d312c2 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 db2ffdfeca4..b59d75b2318 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 3442f91af02..b886f1cce76 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 bb84f2b21a3..123e1919cec 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 4cc43dfd9e1..91ca925be0e 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 2ec2394afb9..60ed5cd8bf9 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_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
> index acd7de571f8..13fcca4aa11 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 9545dcce3de..cd83f1c0fe5 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 0841bb4deee..0a2bbc4bfde 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 744fe60e8e0..5291bb9e986 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 cf182190e91..96611b5e57b 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 2d6cffc4694..fadb7fff993 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 694d560a621..baf94efe733 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 6e7c72510ff..b0cb0da78e0 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 c744ece6407..dbe000a463e 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 e710a544ff0..d719e0a2257 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 e049e0c30e0..2ba1ee05700 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 70659c00c0e..6c803908781 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 50d86a00485..b9e40e964c1 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 9f9c61aa213..860cde12c0f 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 f216e83c7b3..c7ef73ad59e 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 7d6a724e4ad..0ddad573129 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 f68be2b3379..8c3d9a4fc58 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 ec08d6c0318..1fc8f089345 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 467903bf3fc..46f0d0c2317 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 12f09016943..3fa71685ace 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 cbd6a80d345..00f41c3e4f4 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 da4847320b1..e8848c30acc 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 92b2df80ec8..2e7b5b496ea 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 718b7466e50..7bb8d060631 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 c015191ca32..8708079d397 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 055369bf8b1..695af5757cc 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 5e034d26947..eb6d8686c6a 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=target,optimizers" "" "" ""
>  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 709cd21e671..a732bc466db 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/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
> index d0cffa05290..1c1f0eea52e 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 60f9d50d866..d5a2e32db97 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 9a7e32d6f2f..526f48921fd 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 c670d3780e8..6b5c5a73e96 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 f957b57bb00..a0fc8275a84 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
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-24 14:27                     ` Martin Sebor
@ 2021-09-26  3:18                       ` liuhongt
  2021-09-28 11:18                         ` Richard Biener
  2021-10-07 15:34                         ` Martin Liška
  0 siblings, 2 replies; 39+ messages in thread
From: liuhongt @ 2021-09-26  3:18 UTC (permalink / raw)
  To: gcc-patches
  Cc: rguenther, jakub, fweimer, segher, richard.sandiford,
	Premachandra.Mallappa, wschmidt, joseph

Hi:
> Please don't add the -fno- option to the warning tests.  As I said,
> I would prefer to either suppress the vectorization for the failing
> cases by tweaking the test code or xfail them.  That way future
> regressions won't be masked by the option.  Once we've moved
> the warning to a more suitable pass we'll add a new test to verify
> it works as intended or remove the xfails.

Remove -fno-tree-vectorize from the warning tests, and add xfails to them.
The warning information is mainly affected by vectorization of 4 or 2 char
store. Some targets support both, some targets only support one of them,
and some targets supported neither, which means the warning information
would differ from targets to targets.
I only added xfail { x86_64-*-* i?86-*-* }, other backends may need to
re-adjust these xfail.

  Bootstrapped and regtested on x86_64-linux-gnu{-m32,}.

gcc/ChangeLog:

	* common.opt (ftree-vectorize): Add Var(flag_tree_vectorize).
	* doc/invoke.texi (Options That Control Optimization): Update
	documents.
	* opts.c (default_options_table): Enable auto-vectorization at
	O2 with very-cheap cost model.
	(finish_options): Use cheap cost model for
	explicit -ftree{,-loop}-vectorize.

gcc/testsuite/ChangeLog:

	* c-c++-common/Wstringop-overflow-2.c: Adjust testcase.
	* g++.dg/tree-ssa/pr81408.C: Ditto.
	* g++.dg/warn/Wuninitialized-13.C: Ditto.
	* gcc.dg/Warray-bounds-51.c: Ditto.
	* gcc.dg/Warray-parameter-3.c: Ditto.
	* gcc.dg/Wstringop-overflow-14.c: Ditto.
	* gcc.dg/Wstringop-overflow-21.c: Ditto.
	* gcc.dg/Wstringop-overflow-68.c: Ditto.
	* gcc.dg/Wstringop-overflow-76.c: Ditto.
	* gcc.dg/gomp/pr46032-2.c: Ditto.
	* gcc.dg/gomp/pr46032-3.c: Ditto.
	* gcc.dg/gomp/simd-2.c: Ditto.
	* gcc.dg/gomp/simd-3.c: Ditto.
	* gcc.dg/graphite/fuse-1.c: Ditto.
	* gcc.dg/pr67089-6.c: Ditto.
	* gcc.dg/pr82929-2.c: Ditto.
	* gcc.dg/pr82929.c: Ditto.
	* gcc.dg/store_merging_1.c: Ditto.
	* gcc.dg/store_merging_11.c: Ditto.
	* gcc.dg/store_merging_15.c: Ditto.
	* gcc.dg/store_merging_16.c: Ditto.
	* gcc.dg/store_merging_19.c: Ditto.
	* gcc.dg/store_merging_24.c: Ditto.
	* gcc.dg/store_merging_25.c: Ditto.
	* gcc.dg/store_merging_28.c: Ditto.
	* gcc.dg/store_merging_30.c: Ditto.
	* gcc.dg/store_merging_5.c: Ditto.
	* gcc.dg/store_merging_7.c: Ditto.
	* gcc.dg/store_merging_8.c: Ditto.
	* gcc.dg/strlenopt-85.c: Ditto.
	* gcc.dg/tree-ssa/dump-6.c: Ditto.
	* gcc.dg/tree-ssa/pr19210-1.c: Ditto.
	* gcc.dg/tree-ssa/pr47059.c: Ditto.
	* gcc.dg/tree-ssa/pr86017.c: Ditto.
	* gcc.dg/tree-ssa/pr91482.c: Ditto.
	* gcc.dg/tree-ssa/predcom-1.c: Ditto.
	* gcc.dg/tree-ssa/predcom-dse-3.c: Ditto.
	* gcc.dg/tree-ssa/prefetch-3.c: Ditto.
	* gcc.dg/tree-ssa/prefetch-6.c: Ditto.
	* gcc.dg/tree-ssa/prefetch-8.c: Ditto.
	* gcc.dg/tree-ssa/prefetch-9.c: Ditto.
	* gcc.dg/tree-ssa/ssa-dse-18.c: Ditto.
	* gcc.dg/tree-ssa/ssa-dse-19.c: Ditto.
	* gcc.dg/uninit-40.c: Ditto.
	* gcc.dg/unroll-7.c: Ditto.
	* gcc.misc-tests/help.exp: Ditto.
	* gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
	* gcc.target/i386/pr34012.c: Ditto.
	* gcc.target/i386/pr49781-1.c: Ditto.
	* gcc.target/i386/pr95798-1.c: Ditto.
	* gcc.target/i386/pr95798-2.c: Ditto.
	* gfortran.dg/pr77498.f: Ditto.
---
 gcc/common.opt                                |  2 +-
 gcc/doc/invoke.texi                           |  8 ++++----
 gcc/opts.c                                    | 17 +++++++++++++---
 .../c-c++-common/Wstringop-overflow-2.c       | 20 +++++++++----------
 gcc/testsuite/g++.dg/tree-ssa/pr81408.C       |  2 +-
 gcc/testsuite/g++.dg/warn/Wuninitialized-13.C |  2 +-
 gcc/testsuite/gcc.dg/Warray-bounds-51.c       |  2 +-
 gcc/testsuite/gcc.dg/Warray-parameter-3.c     |  4 ++--
 gcc/testsuite/gcc.dg/Wstringop-overflow-14.c  |  4 ++--
 gcc/testsuite/gcc.dg/Wstringop-overflow-21.c  |  8 ++++----
 gcc/testsuite/gcc.dg/Wstringop-overflow-68.c  | 10 +++++-----
 gcc/testsuite/gcc.dg/Wstringop-overflow-76.c  | 20 +++++++++----------
 gcc/testsuite/gcc.dg/gomp/pr46032-2.c         |  2 +-
 gcc/testsuite/gcc.dg/gomp/pr46032-3.c         |  2 +-
 gcc/testsuite/gcc.dg/gomp/simd-2.c            |  2 +-
 gcc/testsuite/gcc.dg/gomp/simd-3.c            |  2 +-
 gcc/testsuite/gcc.dg/graphite/fuse-1.c        |  2 +-
 gcc/testsuite/gcc.dg/pr67089-6.c              |  2 +-
 gcc/testsuite/gcc.dg/pr82929-2.c              |  2 +-
 gcc/testsuite/gcc.dg/pr82929.c                |  2 +-
 gcc/testsuite/gcc.dg/store_merging_1.c        |  2 +-
 gcc/testsuite/gcc.dg/store_merging_11.c       |  2 +-
 gcc/testsuite/gcc.dg/store_merging_15.c       |  2 +-
 gcc/testsuite/gcc.dg/store_merging_16.c       |  2 +-
 gcc/testsuite/gcc.dg/store_merging_19.c       |  2 +-
 gcc/testsuite/gcc.dg/store_merging_24.c       |  2 +-
 gcc/testsuite/gcc.dg/store_merging_25.c       |  2 +-
 gcc/testsuite/gcc.dg/store_merging_28.c       |  2 +-
 gcc/testsuite/gcc.dg/store_merging_30.c       |  2 +-
 gcc/testsuite/gcc.dg/store_merging_5.c        |  2 +-
 gcc/testsuite/gcc.dg/store_merging_7.c        |  2 +-
 gcc/testsuite/gcc.dg/store_merging_8.c        |  2 +-
 gcc/testsuite/gcc.dg/strlenopt-85.c           |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/dump-6.c        |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c     |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr47059.c       |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr86017.c       |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr91482.c       |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c     |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c    |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c    |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c    |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c    |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c    |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c    |  2 +-
 gcc/testsuite/gcc.dg/uninit-40.c              |  2 +-
 gcc/testsuite/gcc.dg/unroll-7.c               |  2 +-
 gcc/testsuite/gcc.misc-tests/help.exp         |  2 +-
 .../i386/avx512vpopcntdqvl-vpopcntd-1.c       |  2 +-
 gcc/testsuite/gcc.target/i386/pr34012.c       |  2 +-
 gcc/testsuite/gcc.target/i386/pr49781-1.c     |  2 +-
 gcc/testsuite/gcc.target/i386/pr95798-1.c     |  2 +-
 gcc/testsuite/gcc.target/i386/pr95798-2.c     |  2 +-
 gcc/testsuite/gfortran.dg/pr77498.f           |  2 +-
 55 files changed, 98 insertions(+), 87 deletions(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index b921f5e3b25..4f2c0294c29 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -3031,7 +3031,7 @@ Perform variable tracking and also tag variables that are uninitialized.
 
 ; 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/doc/invoke.texi b/gcc/doc/invoke.texi
index ba98eab68a5..bde74389107 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10411,9 +10411,12 @@ also turns on the following optimization flags:
 -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.
@@ -10433,11 +10436,8 @@ by @option{-O2} and also turns on the following optimization flags:
 -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/opts.c b/gcc/opts.c
index 1d2d22d7a3f..17765462316 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -634,7 +634,8 @@ static const struct default_options default_options_table[] =
     { 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 @@ static const struct default_options default_options_table[] =
     { 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 @@ static const struct default_options default_options_table[] =
     { 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 },
@@ -1331,6 +1332,16 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
       = (opts->x_flag_unroll_loops
          || opts->x_flag_peel_loops
          || opts->x_optimize >= 3);
+
+  /* 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/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
index 1d79930cd58..7e9da8a02cb 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 @@ void ga1__ (void)
   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 @@ void ga1_0_ (void)
   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 @@ void ga1_1 (void)
   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 @@ void ga1i__ (void)
   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 @@ void ga1i_0_ (void)
   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 @@ void ga1i_1 (void)
   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 39e32fd4bc9..bc14309480c 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 49ee878806a..210e74c3c3b 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 6028b11637c..b0b8bdb7938 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
@@ -38,7 +38,7 @@ void test_struct_char_vla_location (void)
   } 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 cbf3e9339f5..e2c47e1ed36 100644
--- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
+++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
@@ -59,7 +59,7 @@ void fas1 (int[static 2]);    // { dg-warning "\\\[-Warray-parameter=" }
 
 /* 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 @@ gia3 (int a[3])
 __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 d6201b068b6..b648f5b41b1 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_memcpy_cond (int i)
 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 3a27460220c..e88f7b47894 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
@@ -23,10 +23,10 @@ void test_store_zero_length (int i)
 {
   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 @@ void test_store_flexarray (int i)
 {
   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 6bcba274541..09df0004991 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_zero (void)
 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 18191a1aa5e..30b1c9af2e8 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 @@ void max_a3_a5 (int i)
      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 @@ void max_b6_b4 (int i)
   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 @@ void max_d8_p (char *q, int i)
 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 @@ void max_A3_A5 (int i, struct A3_5 *pa3_5)
   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 @@ void max_B6_B4 (int i, struct B4_B6 *pb4_b6)
   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 e110880bd8e..2e562618489 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 a4af7ec4a8a..da1ab487385 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 85acb980f10..f4912127b81 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 86fee858673..c75060c07ae 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 527b6e5c415..61289d312c2 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 db2ffdfeca4..b59d75b2318 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 3442f91af02..b886f1cce76 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 bb84f2b21a3..123e1919cec 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 4cc43dfd9e1..91ca925be0e 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 2ec2394afb9..60ed5cd8bf9 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_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
index acd7de571f8..13fcca4aa11 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 9545dcce3de..cd83f1c0fe5 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 0841bb4deee..0a2bbc4bfde 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 744fe60e8e0..5291bb9e986 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 cf182190e91..96611b5e57b 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 2d6cffc4694..fadb7fff993 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 694d560a621..baf94efe733 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 6e7c72510ff..b0cb0da78e0 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 c744ece6407..dbe000a463e 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 e710a544ff0..d719e0a2257 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 e049e0c30e0..2ba1ee05700 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 70659c00c0e..6c803908781 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 50d86a00485..b9e40e964c1 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 9f9c61aa213..860cde12c0f 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 f216e83c7b3..c7ef73ad59e 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 7d6a724e4ad..0ddad573129 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 f68be2b3379..8c3d9a4fc58 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 ec08d6c0318..1fc8f089345 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 467903bf3fc..46f0d0c2317 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 12f09016943..3fa71685ace 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 cbd6a80d345..00f41c3e4f4 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 da4847320b1..e8848c30acc 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 92b2df80ec8..2e7b5b496ea 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 718b7466e50..7bb8d060631 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 c015191ca32..8708079d397 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 055369bf8b1..695af5757cc 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 5e034d26947..eb6d8686c6a 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=target,optimizers" "" "" ""
 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 709cd21e671..a732bc466db 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/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
index d0cffa05290..1c1f0eea52e 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 60f9d50d866..d5a2e32db97 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 9a7e32d6f2f..526f48921fd 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 c670d3780e8..6b5c5a73e96 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 f957b57bb00..a0fc8275a84 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
-- 
2.27.0


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-24  3:32                   ` Hongtao Liu
@ 2021-09-24 14:27                     ` Martin Sebor
  2021-09-26  3:18                       ` liuhongt
  0 siblings, 1 reply; 39+ messages in thread
From: Martin Sebor @ 2021-09-24 14:27 UTC (permalink / raw)
  To: Hongtao Liu
  Cc: Richard Biener, Jakub Jelinek, Florian Weimer,
	Segher Boessenkool, Richard Sandiford, Premachandra.Mallappa,
	GCC Patches, Bill Schmidt, liuhongt, Joseph Myers

On 9/23/21 9:32 PM, Hongtao Liu wrote:
> On Thu, Sep 23, 2021 at 11:18 PM Martin Sebor <msebor@gmail.com> wrote:
>>
>> On 9/23/21 12:30 AM, Richard Biener wrote:
>>> On Thu, 23 Sep 2021, Hongtao Liu wrote:
>>>
>>>> On Thu, Sep 23, 2021 at 9:48 AM Hongtao Liu <crazylht@gmail.com> wrote:
>>>>>
>>>>> On Wed, Sep 22, 2021 at 10:21 PM Martin Sebor <msebor@gmail.com> wrote:
>>>>>>
>>>>>> On 9/21/21 7:38 PM, Hongtao Liu wrote:
>>>>>>> On Mon, Sep 20, 2021 at 4:13 AM Martin Sebor <msebor@gmail.com> wrote:
>>>>>> ...
>>>>>>>>>>> diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>>>>>>>>>> index 1d79930cd58..9351f7e7a1a 100644
>>>>>>>>>>> --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>>>>>>>>>> +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>>>>>>>>>> @@ -1,7 +1,7 @@
>>>>>>>>>>>      /* PR middle-end/91458 - inconsistent warning for writing past the end
>>>>>>>>>>>         of an array member
>>>>>>>>>>>         { dg-do compile }
>>>>>>>>>>> -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
>>>>>>>>>>> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
>>>>>>>>>>
>>>>>>>>>> The testcase is large - what part requires this change?  Given the
>>>>>>>>>> testcase was added for inconsistent warnings do they now become
>>>>>>>>>> inconsistent again as we enable vectorization at -O2?
>>>>>>>>>>
>>>>>>>>>> That said, the testcase adjustments need some explaining - I suppose
>>>>>>>>>> you didn't just slap -fno-tree-vectorize to all of those changing
>>>>>>>>>> behavior?
>>>>>>>>>>
>>>>>>>>> void ga1_ (void)
>>>>>>>>> {
>>>>>>>>>       a1_.a[0] = 0;
>>>>>>>>>       a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
>>>>>>>>>       a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
>>>>>>>>>
>>>>>>>>>       struct A1 a;
>>>>>>>>>       a.a[0] = 0;
>>>>>>>>>       a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
>>>>>>>>>       a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
>>>>>>>>>       sink (&a);
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
>>>>>>>>> there are 2 accesses, but after enabling vectorization, there's only
>>>>>>>>> one access, so one warning is missing which causes the failure.
>>>>>>
>>>>>> With the stores vectorized, is the warning on the correct line or
>>>>>> does it point to the first store, the one that's in bounds, as
>>>>>> it does with -O3?  The latter would be a regression at -O2.
>>>>> For the upper case, It points to the second store which is out of
>>>>> bounds, the third store warning is missing.
>>>>>>
>>>>>>>>
>>>>>>>> I would find it preferable to change the test code over disabling
>>>>>>>> optimizations that are on by default.  My concern is that the test
>>>>>>>> would no longer exercise the default behavior.  (The same goes for
>>>>>>>> the -fno-ipa-icf option.)
>>>>>>> Hmm, it's a middle-end test, for some backend, it may not do
>>>>>>> vectorization(it depends on TARGET_VECTOR_MODE_SUPPORTED_P and
>>>>>>> relative cost model).
>>>>>>
>>>>>> Yes, there are quite a few warning tests like that.  Their main
>>>>>> purpose is to verify that in common GCC invocations (i.e., without
>>>>>> any special options) warnings are a) issued when expected and b)
>>>>>> not issued when not expected.  Otherwise, middle end warnings are
>>>>>> known to have both false positives and false negatives in some
>>>>>> invocations, depending on what optimizations are in effect.
>>>>>> Indiscriminately disabling common optimizations for these large
>>>>>> tests and invoking them under artificial conditions would
>>>>>> compromise this goal and hide the problems.
>>>>>>
>>>>>> If enabling vectorization at -O2 causes regressions in the quality
>>>>>> of diagnostics (as the test failure above indicates seems to be
>>>>>> happening) we should investigate these and open bugs for them so
>>>>>> they can be fixed.  We can then tweak the specific failing test
>>>>>> cases to avoid the failures until they are fixed.
>>>>> There are indeed cases of false positives and false negatives
>>>>> .i.e.
>>>>> // Verify warning for access to a definition with an initializer that
>>>>> // initializes the one-element array member.
>>>>> struct A1 a1i_1 = { 0, { 1 } };
>>>>>
>>>>> void ga1i_1 (void)
>>>>> {
>>>>>     a1i_1.a[0] = 0;
>>>>>     a1i_1.a[1] = 1;               // { dg-warning "\\\[-Wstringop-overflow" }
>>>>>     a1i_1.a[2] = 2;               // { dg-warning "\\\[-Wstringop-overflow" }
>>>>>
>>>>>     struct A1 a = { 0, { 1 } }; --- false positive here.
>>>>>     a.a[0] = 1;
>>>>>     a.a[1] = 2;                   // { dg-warning
>>>>> "\\\[-Wstringop-overflow" } false negative here.
>>>>>     a.a[2] = 3;                   // { dg-warning
>>>>> "\\\[-Wstringop-overflow" } false negative here.
>>>>>     sink (&a);
>>>>> }
>>>> Similar for
>>>> * gcc.dg/Warray-bounds-51.c.
>>>> * gcc.dg/Warray-parameter-3.c
>>>> * gcc.dg/Wstringop-overflow-14.c
>>>> * gcc.dg/Wstringop-overflow-21.c
>>>>
>>>> So there're 3 situations.
>>>> 1. All accesses are out of bound, and after vectorization, there are
>>>> some warnings missing.
>>>> 2. Part of accesses are inbound, part of accesses are out of bound,
>>>> and after vectorization, the warning goes from out of bound line to
>>>> inbound line.
>>>> 3. All access are out of bound, and after vectoriation, all warning
>>>> are missing, and goes to a false-positive line.
> My mistake, there's no case3, just case 1 and case2.
> So i'm going to install the patch, ok?

Please don't add the -fno- option to the warning tests.  As I said,
I would prefer to either suppress the vectorization for the failing
cases by tweaking the test code or xfail them.  That way future
regressions won't be masked by the option.  Once we've moved
the warning to a more suitable pass we'll add a new test to verify
it works as intended or remove the xfails.

Thanks
Martin

>>>
>>> I remember some of the warning code explicitely excuses itself from
>>> even trying to deal with vectorized loads/stores, that might need to
>>> be revisited.  It would also be useful to verify whether the line
>>> info on the vectorized loads/stores is sensible (if you dump with
>>> -lineno you get stmts with line numbers).
>>
>> Yes, it's this code in handle_mem_ref() in pointer-query.cc:
>>
>>     if (VECTOR_TYPE_P (TREE_TYPE (mref)))
>>       {
>>         /* Hack: Handle MEM_REFs of vector types as those to complete
>>           objects; those may be synthesized from multiple assignments
>>           to consecutive data members (see PR 93200 and 96963).
>>           FIXME: Vectorized assignments should only be present after
>>           vectorization so this hack is only necessary after it has
>>           run and could be avoided in calls from prior passes (e.g.,
>>           tree-ssa-strlen.c).
>>           FIXME: Deal with this more generally, e.g., by marking up
>>           such MEM_REFs at the time they're created.  */
>>         ostype = 0;
>>       }
>>
>> This code is used by both -Warray-bounds and -Wstringop-overflow
>> but because the former runs before vectorization the former isn't
>> affected by the auto-vectorization change.
>>
>>>
>>> It is of course impossible to preserve the location of all original
>>> scalar accesses exactly - it _might_ be possible to create a new
>>> location range (not sure how they are exactly represented), but then
>>> if we vectorize say
>>>
>>>     a[0] = b[0];
>>>     a[1] = b[1];
>>>
>>> we'd somehow get a multi-line location range that covers unrelated
>>> bits (the intermediate load or store).
>>
>> This sounds like an interesting idea to explore, though I'm not
>> sure what we'd end up with if the stores were discontiguous (i.e.,
>> had unrelated statements in between).
>>
>>>
>>> So currently the vectorizer simply chooses the location of one of
>>> the scalar loads or stores for the vectorized access (and it might do
>>> so quite randomly).
>>>
>>> Note I don't think it's feasible to not vectorize out-of-bound loads
>>> or stores for the same reason that you'll say you can't do the
>>> warnings all before vectorizing because the might expose themselves
>>> only later.
>>
>> Sure, but it would be helpful to at least avoid vectorizing (as
>> well as store merging) the cases where the out-of-bounds access
>> is easily detectable.  As it is, the code I looked at makes no
>> effort to check.
>>
>>>
>>> So we simply have to cope with the reality that GCC is optimizing and
>>> that the later we perform analysis for warnings the more the original
>>> code is mangled.  As we moved array-bound warnings before unrolling
>>> so we should move this particular warning to before vectorization
>>> [loop optimization].
>>
>> That makes sense.  See also my comment 7 on bug 102462 Hongtao
>> opened for this problem.  But just to be clear: I expect moving
>> these warnings won't be entirely straightforward.
>>
>> Martin
> 
> 
> 


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-23 15:18                 ` Martin Sebor
@ 2021-09-24  3:32                   ` Hongtao Liu
  2021-09-24 14:27                     ` Martin Sebor
  0 siblings, 1 reply; 39+ messages in thread
From: Hongtao Liu @ 2021-09-24  3:32 UTC (permalink / raw)
  To: Martin Sebor
  Cc: Richard Biener, Jakub Jelinek, Florian Weimer,
	Segher Boessenkool, Richard Sandiford, Premachandra.Mallappa,
	GCC Patches, Bill Schmidt, liuhongt, Joseph Myers

On Thu, Sep 23, 2021 at 11:18 PM Martin Sebor <msebor@gmail.com> wrote:
>
> On 9/23/21 12:30 AM, Richard Biener wrote:
> > On Thu, 23 Sep 2021, Hongtao Liu wrote:
> >
> >> On Thu, Sep 23, 2021 at 9:48 AM Hongtao Liu <crazylht@gmail.com> wrote:
> >>>
> >>> On Wed, Sep 22, 2021 at 10:21 PM Martin Sebor <msebor@gmail.com> wrote:
> >>>>
> >>>> On 9/21/21 7:38 PM, Hongtao Liu wrote:
> >>>>> On Mon, Sep 20, 2021 at 4:13 AM Martin Sebor <msebor@gmail.com> wrote:
> >>>> ...
> >>>>>>>>> diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> >>>>>>>>> index 1d79930cd58..9351f7e7a1a 100644
> >>>>>>>>> --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> >>>>>>>>> +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> >>>>>>>>> @@ -1,7 +1,7 @@
> >>>>>>>>>     /* PR middle-end/91458 - inconsistent warning for writing past the end
> >>>>>>>>>        of an array member
> >>>>>>>>>        { dg-do compile }
> >>>>>>>>> -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
> >>>>>>>>> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
> >>>>>>>>
> >>>>>>>> The testcase is large - what part requires this change?  Given the
> >>>>>>>> testcase was added for inconsistent warnings do they now become
> >>>>>>>> inconsistent again as we enable vectorization at -O2?
> >>>>>>>>
> >>>>>>>> That said, the testcase adjustments need some explaining - I suppose
> >>>>>>>> you didn't just slap -fno-tree-vectorize to all of those changing
> >>>>>>>> behavior?
> >>>>>>>>
> >>>>>>> void ga1_ (void)
> >>>>>>> {
> >>>>>>>      a1_.a[0] = 0;
> >>>>>>>      a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
> >>>>>>>      a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
> >>>>>>>
> >>>>>>>      struct A1 a;
> >>>>>>>      a.a[0] = 0;
> >>>>>>>      a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
> >>>>>>>      a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
> >>>>>>>      sink (&a);
> >>>>>>> }
> >>>>>>>
> >>>>>>> It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
> >>>>>>> there are 2 accesses, but after enabling vectorization, there's only
> >>>>>>> one access, so one warning is missing which causes the failure.
> >>>>
> >>>> With the stores vectorized, is the warning on the correct line or
> >>>> does it point to the first store, the one that's in bounds, as
> >>>> it does with -O3?  The latter would be a regression at -O2.
> >>> For the upper case, It points to the second store which is out of
> >>> bounds, the third store warning is missing.
> >>>>
> >>>>>>
> >>>>>> I would find it preferable to change the test code over disabling
> >>>>>> optimizations that are on by default.  My concern is that the test
> >>>>>> would no longer exercise the default behavior.  (The same goes for
> >>>>>> the -fno-ipa-icf option.)
> >>>>> Hmm, it's a middle-end test, for some backend, it may not do
> >>>>> vectorization(it depends on TARGET_VECTOR_MODE_SUPPORTED_P and
> >>>>> relative cost model).
> >>>>
> >>>> Yes, there are quite a few warning tests like that.  Their main
> >>>> purpose is to verify that in common GCC invocations (i.e., without
> >>>> any special options) warnings are a) issued when expected and b)
> >>>> not issued when not expected.  Otherwise, middle end warnings are
> >>>> known to have both false positives and false negatives in some
> >>>> invocations, depending on what optimizations are in effect.
> >>>> Indiscriminately disabling common optimizations for these large
> >>>> tests and invoking them under artificial conditions would
> >>>> compromise this goal and hide the problems.
> >>>>
> >>>> If enabling vectorization at -O2 causes regressions in the quality
> >>>> of diagnostics (as the test failure above indicates seems to be
> >>>> happening) we should investigate these and open bugs for them so
> >>>> they can be fixed.  We can then tweak the specific failing test
> >>>> cases to avoid the failures until they are fixed.
> >>> There are indeed cases of false positives and false negatives
> >>> .i.e.
> >>> // Verify warning for access to a definition with an initializer that
> >>> // initializes the one-element array member.
> >>> struct A1 a1i_1 = { 0, { 1 } };
> >>>
> >>> void ga1i_1 (void)
> >>> {
> >>>    a1i_1.a[0] = 0;
> >>>    a1i_1.a[1] = 1;               // { dg-warning "\\\[-Wstringop-overflow" }
> >>>    a1i_1.a[2] = 2;               // { dg-warning "\\\[-Wstringop-overflow" }
> >>>
> >>>    struct A1 a = { 0, { 1 } }; --- false positive here.
> >>>    a.a[0] = 1;
> >>>    a.a[1] = 2;                   // { dg-warning
> >>> "\\\[-Wstringop-overflow" } false negative here.
> >>>    a.a[2] = 3;                   // { dg-warning
> >>> "\\\[-Wstringop-overflow" } false negative here.
> >>>    sink (&a);
> >>> }
> >> Similar for
> >> * gcc.dg/Warray-bounds-51.c.
> >> * gcc.dg/Warray-parameter-3.c
> >> * gcc.dg/Wstringop-overflow-14.c
> >> * gcc.dg/Wstringop-overflow-21.c
> >>
> >> So there're 3 situations.
> >> 1. All accesses are out of bound, and after vectorization, there are
> >> some warnings missing.
> >> 2. Part of accesses are inbound, part of accesses are out of bound,
> >> and after vectorization, the warning goes from out of bound line to
> >> inbound line.
> >> 3. All access are out of bound, and after vectoriation, all warning
> >> are missing, and goes to a false-positive line.
My mistake, there's no case3, just case 1 and case2.
So i'm going to install the patch, ok?
> >
> > I remember some of the warning code explicitely excuses itself from
> > even trying to deal with vectorized loads/stores, that might need to
> > be revisited.  It would also be useful to verify whether the line
> > info on the vectorized loads/stores is sensible (if you dump with
> > -lineno you get stmts with line numbers).
>
> Yes, it's this code in handle_mem_ref() in pointer-query.cc:
>
>    if (VECTOR_TYPE_P (TREE_TYPE (mref)))
>      {
>        /* Hack: Handle MEM_REFs of vector types as those to complete
>          objects; those may be synthesized from multiple assignments
>          to consecutive data members (see PR 93200 and 96963).
>          FIXME: Vectorized assignments should only be present after
>          vectorization so this hack is only necessary after it has
>          run and could be avoided in calls from prior passes (e.g.,
>          tree-ssa-strlen.c).
>          FIXME: Deal with this more generally, e.g., by marking up
>          such MEM_REFs at the time they're created.  */
>        ostype = 0;
>      }
>
> This code is used by both -Warray-bounds and -Wstringop-overflow
> but because the former runs before vectorization the former isn't
> affected by the auto-vectorization change.
>
> >
> > It is of course impossible to preserve the location of all original
> > scalar accesses exactly - it _might_ be possible to create a new
> > location range (not sure how they are exactly represented), but then
> > if we vectorize say
> >
> >    a[0] = b[0];
> >    a[1] = b[1];
> >
> > we'd somehow get a multi-line location range that covers unrelated
> > bits (the intermediate load or store).
>
> This sounds like an interesting idea to explore, though I'm not
> sure what we'd end up with if the stores were discontiguous (i.e.,
> had unrelated statements in between).
>
> >
> > So currently the vectorizer simply chooses the location of one of
> > the scalar loads or stores for the vectorized access (and it might do
> > so quite randomly).
> >
> > Note I don't think it's feasible to not vectorize out-of-bound loads
> > or stores for the same reason that you'll say you can't do the
> > warnings all before vectorizing because the might expose themselves
> > only later.
>
> Sure, but it would be helpful to at least avoid vectorizing (as
> well as store merging) the cases where the out-of-bounds access
> is easily detectable.  As it is, the code I looked at makes no
> effort to check.
>
> >
> > So we simply have to cope with the reality that GCC is optimizing and
> > that the later we perform analysis for warnings the more the original
> > code is mangled.  As we moved array-bound warnings before unrolling
> > so we should move this particular warning to before vectorization
> > [loop optimization].
>
> That makes sense.  See also my comment 7 on bug 102462 Hongtao
> opened for this problem.  But just to be clear: I expect moving
> these warnings won't be entirely straightforward.
>
> Martin



-- 
BR,
Hongtao

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-23  6:30               ` Richard Biener
@ 2021-09-23 15:18                 ` Martin Sebor
  2021-09-24  3:32                   ` Hongtao Liu
  2021-10-08 10:49                 ` Aldy Hernandez
  1 sibling, 1 reply; 39+ messages in thread
From: Martin Sebor @ 2021-09-23 15:18 UTC (permalink / raw)
  To: Richard Biener, Hongtao Liu
  Cc: Jakub Jelinek, Florian Weimer, Segher Boessenkool,
	Richard Sandiford, Premachandra.Mallappa, GCC Patches,
	Bill Schmidt, liuhongt, Joseph Myers

On 9/23/21 12:30 AM, Richard Biener wrote:
> On Thu, 23 Sep 2021, Hongtao Liu wrote:
> 
>> On Thu, Sep 23, 2021 at 9:48 AM Hongtao Liu <crazylht@gmail.com> wrote:
>>>
>>> On Wed, Sep 22, 2021 at 10:21 PM Martin Sebor <msebor@gmail.com> wrote:
>>>>
>>>> On 9/21/21 7:38 PM, Hongtao Liu wrote:
>>>>> On Mon, Sep 20, 2021 at 4:13 AM Martin Sebor <msebor@gmail.com> wrote:
>>>> ...
>>>>>>>>> diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>>>>>>>> index 1d79930cd58..9351f7e7a1a 100644
>>>>>>>>> --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>>>>>>>> +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>>>>>>>> @@ -1,7 +1,7 @@
>>>>>>>>>     /* PR middle-end/91458 - inconsistent warning for writing past the end
>>>>>>>>>        of an array member
>>>>>>>>>        { dg-do compile }
>>>>>>>>> -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
>>>>>>>>> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
>>>>>>>>
>>>>>>>> The testcase is large - what part requires this change?  Given the
>>>>>>>> testcase was added for inconsistent warnings do they now become
>>>>>>>> inconsistent again as we enable vectorization at -O2?
>>>>>>>>
>>>>>>>> That said, the testcase adjustments need some explaining - I suppose
>>>>>>>> you didn't just slap -fno-tree-vectorize to all of those changing
>>>>>>>> behavior?
>>>>>>>>
>>>>>>> void ga1_ (void)
>>>>>>> {
>>>>>>>      a1_.a[0] = 0;
>>>>>>>      a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
>>>>>>>      a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
>>>>>>>
>>>>>>>      struct A1 a;
>>>>>>>      a.a[0] = 0;
>>>>>>>      a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
>>>>>>>      a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
>>>>>>>      sink (&a);
>>>>>>> }
>>>>>>>
>>>>>>> It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
>>>>>>> there are 2 accesses, but after enabling vectorization, there's only
>>>>>>> one access, so one warning is missing which causes the failure.
>>>>
>>>> With the stores vectorized, is the warning on the correct line or
>>>> does it point to the first store, the one that's in bounds, as
>>>> it does with -O3?  The latter would be a regression at -O2.
>>> For the upper case, It points to the second store which is out of
>>> bounds, the third store warning is missing.
>>>>
>>>>>>
>>>>>> I would find it preferable to change the test code over disabling
>>>>>> optimizations that are on by default.  My concern is that the test
>>>>>> would no longer exercise the default behavior.  (The same goes for
>>>>>> the -fno-ipa-icf option.)
>>>>> Hmm, it's a middle-end test, for some backend, it may not do
>>>>> vectorization(it depends on TARGET_VECTOR_MODE_SUPPORTED_P and
>>>>> relative cost model).
>>>>
>>>> Yes, there are quite a few warning tests like that.  Their main
>>>> purpose is to verify that in common GCC invocations (i.e., without
>>>> any special options) warnings are a) issued when expected and b)
>>>> not issued when not expected.  Otherwise, middle end warnings are
>>>> known to have both false positives and false negatives in some
>>>> invocations, depending on what optimizations are in effect.
>>>> Indiscriminately disabling common optimizations for these large
>>>> tests and invoking them under artificial conditions would
>>>> compromise this goal and hide the problems.
>>>>
>>>> If enabling vectorization at -O2 causes regressions in the quality
>>>> of diagnostics (as the test failure above indicates seems to be
>>>> happening) we should investigate these and open bugs for them so
>>>> they can be fixed.  We can then tweak the specific failing test
>>>> cases to avoid the failures until they are fixed.
>>> There are indeed cases of false positives and false negatives
>>> .i.e.
>>> // Verify warning for access to a definition with an initializer that
>>> // initializes the one-element array member.
>>> struct A1 a1i_1 = { 0, { 1 } };
>>>
>>> void ga1i_1 (void)
>>> {
>>>    a1i_1.a[0] = 0;
>>>    a1i_1.a[1] = 1;               // { dg-warning "\\\[-Wstringop-overflow" }
>>>    a1i_1.a[2] = 2;               // { dg-warning "\\\[-Wstringop-overflow" }
>>>
>>>    struct A1 a = { 0, { 1 } }; --- false positive here.
>>>    a.a[0] = 1;
>>>    a.a[1] = 2;                   // { dg-warning
>>> "\\\[-Wstringop-overflow" } false negative here.
>>>    a.a[2] = 3;                   // { dg-warning
>>> "\\\[-Wstringop-overflow" } false negative here.
>>>    sink (&a);
>>> }
>> Similar for
>> * gcc.dg/Warray-bounds-51.c.
>> * gcc.dg/Warray-parameter-3.c
>> * gcc.dg/Wstringop-overflow-14.c
>> * gcc.dg/Wstringop-overflow-21.c
>>
>> So there're 3 situations.
>> 1. All accesses are out of bound, and after vectorization, there are
>> some warnings missing.
>> 2. Part of accesses are inbound, part of accesses are out of bound,
>> and after vectorization, the warning goes from out of bound line to
>> inbound line.
>> 3. All access are out of bound, and after vectoriation, all warning
>> are missing, and goes to a false-positive line.
> 
> I remember some of the warning code explicitely excuses itself from
> even trying to deal with vectorized loads/stores, that might need to
> be revisited.  It would also be useful to verify whether the line
> info on the vectorized loads/stores is sensible (if you dump with
> -lineno you get stmts with line numbers).

Yes, it's this code in handle_mem_ref() in pointer-query.cc:

   if (VECTOR_TYPE_P (TREE_TYPE (mref)))
     {
       /* Hack: Handle MEM_REFs of vector types as those to complete
	 objects; those may be synthesized from multiple assignments
	 to consecutive data members (see PR 93200 and 96963).
	 FIXME: Vectorized assignments should only be present after
	 vectorization so this hack is only necessary after it has
	 run and could be avoided in calls from prior passes (e.g.,
	 tree-ssa-strlen.c).
	 FIXME: Deal with this more generally, e.g., by marking up
	 such MEM_REFs at the time they're created.  */
       ostype = 0;
     }

This code is used by both -Warray-bounds and -Wstringop-overflow
but because the former runs before vectorization the former isn't
affected by the auto-vectorization change.

> 
> It is of course impossible to preserve the location of all original
> scalar accesses exactly - it _might_ be possible to create a new
> location range (not sure how they are exactly represented), but then
> if we vectorize say
> 
>    a[0] = b[0];
>    a[1] = b[1];
> 
> we'd somehow get a multi-line location range that covers unrelated
> bits (the intermediate load or store).

This sounds like an interesting idea to explore, though I'm not
sure what we'd end up with if the stores were discontiguous (i.e.,
had unrelated statements in between).

> 
> So currently the vectorizer simply chooses the location of one of
> the scalar loads or stores for the vectorized access (and it might do
> so quite randomly).
> 
> Note I don't think it's feasible to not vectorize out-of-bound loads
> or stores for the same reason that you'll say you can't do the
> warnings all before vectorizing because the might expose themselves
> only later.

Sure, but it would be helpful to at least avoid vectorizing (as
well as store merging) the cases where the out-of-bounds access
is easily detectable.  As it is, the code I looked at makes no
effort to check.

> 
> So we simply have to cope with the reality that GCC is optimizing and
> that the later we perform analysis for warnings the more the original
> code is mangled.  As we moved array-bound warnings before unrolling
> so we should move this particular warning to before vectorization
> [loop optimization].

That makes sense.  See also my comment 7 on bug 102462 Hongtao
opened for this problem.  But just to be clear: I expect moving
these warnings won't be entirely straightforward.

Martin

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-23  2:08             ` Hongtao Liu
@ 2021-09-23  6:30               ` Richard Biener
  2021-09-23 15:18                 ` Martin Sebor
  2021-10-08 10:49                 ` Aldy Hernandez
  0 siblings, 2 replies; 39+ messages in thread
From: Richard Biener @ 2021-09-23  6:30 UTC (permalink / raw)
  To: Hongtao Liu
  Cc: Martin Sebor, Jakub Jelinek, Florian Weimer, Segher Boessenkool,
	Richard Sandiford, Premachandra.Mallappa, GCC Patches,
	Bill Schmidt, liuhongt, Joseph Myers

On Thu, 23 Sep 2021, Hongtao Liu wrote:

> On Thu, Sep 23, 2021 at 9:48 AM Hongtao Liu <crazylht@gmail.com> wrote:
> >
> > On Wed, Sep 22, 2021 at 10:21 PM Martin Sebor <msebor@gmail.com> wrote:
> > >
> > > On 9/21/21 7:38 PM, Hongtao Liu wrote:
> > > > On Mon, Sep 20, 2021 at 4:13 AM Martin Sebor <msebor@gmail.com> wrote:
> > > ...
> > > >>>>> diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > >>>>> index 1d79930cd58..9351f7e7a1a 100644
> > > >>>>> --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > >>>>> +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > >>>>> @@ -1,7 +1,7 @@
> > > >>>>>    /* PR middle-end/91458 - inconsistent warning for writing past the end
> > > >>>>>       of an array member
> > > >>>>>       { dg-do compile }
> > > >>>>> -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
> > > >>>>> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
> > > >>>>
> > > >>>> The testcase is large - what part requires this change?  Given the
> > > >>>> testcase was added for inconsistent warnings do they now become
> > > >>>> inconsistent again as we enable vectorization at -O2?
> > > >>>>
> > > >>>> That said, the testcase adjustments need some explaining - I suppose
> > > >>>> you didn't just slap -fno-tree-vectorize to all of those changing
> > > >>>> behavior?
> > > >>>>
> > > >>> void ga1_ (void)
> > > >>> {
> > > >>>     a1_.a[0] = 0;
> > > >>>     a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
> > > >>>     a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
> > > >>>
> > > >>>     struct A1 a;
> > > >>>     a.a[0] = 0;
> > > >>>     a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
> > > >>>     a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
> > > >>>     sink (&a);
> > > >>> }
> > > >>>
> > > >>> It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
> > > >>> there are 2 accesses, but after enabling vectorization, there's only
> > > >>> one access, so one warning is missing which causes the failure.
> > >
> > > With the stores vectorized, is the warning on the correct line or
> > > does it point to the first store, the one that's in bounds, as
> > > it does with -O3?  The latter would be a regression at -O2.
> > For the upper case, It points to the second store which is out of
> > bounds, the third store warning is missing.
> > >
> > > >>
> > > >> I would find it preferable to change the test code over disabling
> > > >> optimizations that are on by default.  My concern is that the test
> > > >> would no longer exercise the default behavior.  (The same goes for
> > > >> the -fno-ipa-icf option.)
> > > > Hmm, it's a middle-end test, for some backend, it may not do
> > > > vectorization(it depends on TARGET_VECTOR_MODE_SUPPORTED_P and
> > > > relative cost model).
> > >
> > > Yes, there are quite a few warning tests like that.  Their main
> > > purpose is to verify that in common GCC invocations (i.e., without
> > > any special options) warnings are a) issued when expected and b)
> > > not issued when not expected.  Otherwise, middle end warnings are
> > > known to have both false positives and false negatives in some
> > > invocations, depending on what optimizations are in effect.
> > > Indiscriminately disabling common optimizations for these large
> > > tests and invoking them under artificial conditions would
> > > compromise this goal and hide the problems.
> > >
> > > If enabling vectorization at -O2 causes regressions in the quality
> > > of diagnostics (as the test failure above indicates seems to be
> > > happening) we should investigate these and open bugs for them so
> > > they can be fixed.  We can then tweak the specific failing test
> > > cases to avoid the failures until they are fixed.
> > There are indeed cases of false positives and false negatives
> > .i.e.
> > // Verify warning for access to a definition with an initializer that
> > // initializes the one-element array member.
> > struct A1 a1i_1 = { 0, { 1 } };
> >
> > void ga1i_1 (void)
> > {
> >   a1i_1.a[0] = 0;
> >   a1i_1.a[1] = 1;               // { dg-warning "\\\[-Wstringop-overflow" }
> >   a1i_1.a[2] = 2;               // { dg-warning "\\\[-Wstringop-overflow" }
> >
> >   struct A1 a = { 0, { 1 } }; --- false positive here.
> >   a.a[0] = 1;
> >   a.a[1] = 2;                   // { dg-warning
> > "\\\[-Wstringop-overflow" } false negative here.
> >   a.a[2] = 3;                   // { dg-warning
> > "\\\[-Wstringop-overflow" } false negative here.
> >   sink (&a);
> > }
> Similar for
> * gcc.dg/Warray-bounds-51.c.
> * gcc.dg/Warray-parameter-3.c
> * gcc.dg/Wstringop-overflow-14.c
> * gcc.dg/Wstringop-overflow-21.c
> 
> So there're 3 situations.
> 1. All accesses are out of bound, and after vectorization, there are
> some warnings missing.
> 2. Part of accesses are inbound, part of accesses are out of bound,
> and after vectorization, the warning goes from out of bound line to
> inbound line.
> 3. All access are out of bound, and after vectoriation, all warning
> are missing, and goes to a false-positive line.

I remember some of the warning code explicitely excuses itself from
even trying to deal with vectorized loads/stores, that might need to
be revisited.  It would also be useful to verify whether the line
info on the vectorized loads/stores is sensible (if you dump with
-lineno you get stmts with line numbers).

It is of course impossible to preserve the location of all original
scalar accesses exactly - it _might_ be possible to create a new
location range (not sure how they are exactly represented), but then
if we vectorize say

  a[0] = b[0];
  a[1] = b[1];

we'd somehow get a multi-line location range that covers unrelated
bits (the intermediate load or store).

So currently the vectorizer simply chooses the location of one of
the scalar loads or stores for the vectorized access (and it might do
so quite randomly).

Note I don't think it's feasible to not vectorize out-of-bound loads
or stores for the same reason that you'll say you can't do the
warnings all before vectorizing because the might expose themselves
only later.

So we simply have to cope with the reality that GCC is optimizing and
that the later we perform analysis for warnings the more the original
code is mangled.  As we moved array-bound warnings before unrolling
so we should move this particular warning to before vectorization
[loop optimization].

Richard.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-23  1:48           ` Hongtao Liu
@ 2021-09-23  2:08             ` Hongtao Liu
  2021-09-23  6:30               ` Richard Biener
  0 siblings, 1 reply; 39+ messages in thread
From: Hongtao Liu @ 2021-09-23  2:08 UTC (permalink / raw)
  To: Martin Sebor
  Cc: Richard Biener, Jakub Jelinek, Florian Weimer,
	Segher Boessenkool, Richard Sandiford, Premachandra.Mallappa,
	GCC Patches, Bill Schmidt, liuhongt, Joseph Myers

On Thu, Sep 23, 2021 at 9:48 AM Hongtao Liu <crazylht@gmail.com> wrote:
>
> On Wed, Sep 22, 2021 at 10:21 PM Martin Sebor <msebor@gmail.com> wrote:
> >
> > On 9/21/21 7:38 PM, Hongtao Liu wrote:
> > > On Mon, Sep 20, 2021 at 4:13 AM Martin Sebor <msebor@gmail.com> wrote:
> > ...
> > >>>>> diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > >>>>> index 1d79930cd58..9351f7e7a1a 100644
> > >>>>> --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > >>>>> +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > >>>>> @@ -1,7 +1,7 @@
> > >>>>>    /* PR middle-end/91458 - inconsistent warning for writing past the end
> > >>>>>       of an array member
> > >>>>>       { dg-do compile }
> > >>>>> -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
> > >>>>> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
> > >>>>
> > >>>> The testcase is large - what part requires this change?  Given the
> > >>>> testcase was added for inconsistent warnings do they now become
> > >>>> inconsistent again as we enable vectorization at -O2?
> > >>>>
> > >>>> That said, the testcase adjustments need some explaining - I suppose
> > >>>> you didn't just slap -fno-tree-vectorize to all of those changing
> > >>>> behavior?
> > >>>>
> > >>> void ga1_ (void)
> > >>> {
> > >>>     a1_.a[0] = 0;
> > >>>     a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
> > >>>     a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
> > >>>
> > >>>     struct A1 a;
> > >>>     a.a[0] = 0;
> > >>>     a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
> > >>>     a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
> > >>>     sink (&a);
> > >>> }
> > >>>
> > >>> It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
> > >>> there are 2 accesses, but after enabling vectorization, there's only
> > >>> one access, so one warning is missing which causes the failure.
> >
> > With the stores vectorized, is the warning on the correct line or
> > does it point to the first store, the one that's in bounds, as
> > it does with -O3?  The latter would be a regression at -O2.
> For the upper case, It points to the second store which is out of
> bounds, the third store warning is missing.
> >
> > >>
> > >> I would find it preferable to change the test code over disabling
> > >> optimizations that are on by default.  My concern is that the test
> > >> would no longer exercise the default behavior.  (The same goes for
> > >> the -fno-ipa-icf option.)
> > > Hmm, it's a middle-end test, for some backend, it may not do
> > > vectorization(it depends on TARGET_VECTOR_MODE_SUPPORTED_P and
> > > relative cost model).
> >
> > Yes, there are quite a few warning tests like that.  Their main
> > purpose is to verify that in common GCC invocations (i.e., without
> > any special options) warnings are a) issued when expected and b)
> > not issued when not expected.  Otherwise, middle end warnings are
> > known to have both false positives and false negatives in some
> > invocations, depending on what optimizations are in effect.
> > Indiscriminately disabling common optimizations for these large
> > tests and invoking them under artificial conditions would
> > compromise this goal and hide the problems.
> >
> > If enabling vectorization at -O2 causes regressions in the quality
> > of diagnostics (as the test failure above indicates seems to be
> > happening) we should investigate these and open bugs for them so
> > they can be fixed.  We can then tweak the specific failing test
> > cases to avoid the failures until they are fixed.
> There are indeed cases of false positives and false negatives
> .i.e.
> // Verify warning for access to a definition with an initializer that
> // initializes the one-element array member.
> struct A1 a1i_1 = { 0, { 1 } };
>
> void ga1i_1 (void)
> {
>   a1i_1.a[0] = 0;
>   a1i_1.a[1] = 1;               // { dg-warning "\\\[-Wstringop-overflow" }
>   a1i_1.a[2] = 2;               // { dg-warning "\\\[-Wstringop-overflow" }
>
>   struct A1 a = { 0, { 1 } }; --- false positive here.
>   a.a[0] = 1;
>   a.a[1] = 2;                   // { dg-warning
> "\\\[-Wstringop-overflow" } false negative here.
>   a.a[2] = 3;                   // { dg-warning
> "\\\[-Wstringop-overflow" } false negative here.
>   sink (&a);
> }
Similar for
* gcc.dg/Warray-bounds-51.c.
* gcc.dg/Warray-parameter-3.c
* gcc.dg/Wstringop-overflow-14.c
* gcc.dg/Wstringop-overflow-21.c

So there're 3 situations.
1. All accesses are out of bound, and after vectorization, there are
some warnings missing.
2. Part of accesses are inbound, part of accesses are out of bound,
and after vectorization, the warning goes from out of bound line to
inbound line.
3. All access are out of bound, and after vectoriation, all warning
are missing, and goes to a false-positive line.
>
> the last 2 warnings are missing, and there's new warning on the line
> *struct A1 a = { 0, { 1 } };
> >
> > Martin
>
>
>
> --
> BR,
> Hongtao



-- 
BR,
Hongtao

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-22 14:21         ` Martin Sebor
  2021-09-22 15:03           ` Martin Sebor
@ 2021-09-23  1:48           ` Hongtao Liu
  2021-09-23  2:08             ` Hongtao Liu
  1 sibling, 1 reply; 39+ messages in thread
From: Hongtao Liu @ 2021-09-23  1:48 UTC (permalink / raw)
  To: Martin Sebor
  Cc: Richard Biener, Jakub Jelinek, Florian Weimer,
	Segher Boessenkool, Richard Sandiford, Premachandra.Mallappa,
	GCC Patches, Bill Schmidt, liuhongt, Joseph Myers

On Wed, Sep 22, 2021 at 10:21 PM Martin Sebor <msebor@gmail.com> wrote:
>
> On 9/21/21 7:38 PM, Hongtao Liu wrote:
> > On Mon, Sep 20, 2021 at 4:13 AM Martin Sebor <msebor@gmail.com> wrote:
> ...
> >>>>> diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> >>>>> index 1d79930cd58..9351f7e7a1a 100644
> >>>>> --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> >>>>> +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> >>>>> @@ -1,7 +1,7 @@
> >>>>>    /* PR middle-end/91458 - inconsistent warning for writing past the end
> >>>>>       of an array member
> >>>>>       { dg-do compile }
> >>>>> -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
> >>>>> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
> >>>>
> >>>> The testcase is large - what part requires this change?  Given the
> >>>> testcase was added for inconsistent warnings do they now become
> >>>> inconsistent again as we enable vectorization at -O2?
> >>>>
> >>>> That said, the testcase adjustments need some explaining - I suppose
> >>>> you didn't just slap -fno-tree-vectorize to all of those changing
> >>>> behavior?
> >>>>
> >>> void ga1_ (void)
> >>> {
> >>>     a1_.a[0] = 0;
> >>>     a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
> >>>     a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
> >>>
> >>>     struct A1 a;
> >>>     a.a[0] = 0;
> >>>     a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
> >>>     a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
> >>>     sink (&a);
> >>> }
> >>>
> >>> It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
> >>> there are 2 accesses, but after enabling vectorization, there's only
> >>> one access, so one warning is missing which causes the failure.
>
> With the stores vectorized, is the warning on the correct line or
> does it point to the first store, the one that's in bounds, as
> it does with -O3?  The latter would be a regression at -O2.
For the upper case, It points to the second store which is out of
bounds, the third store warning is missing.
>
> >>
> >> I would find it preferable to change the test code over disabling
> >> optimizations that are on by default.  My concern is that the test
> >> would no longer exercise the default behavior.  (The same goes for
> >> the -fno-ipa-icf option.)
> > Hmm, it's a middle-end test, for some backend, it may not do
> > vectorization(it depends on TARGET_VECTOR_MODE_SUPPORTED_P and
> > relative cost model).
>
> Yes, there are quite a few warning tests like that.  Their main
> purpose is to verify that in common GCC invocations (i.e., without
> any special options) warnings are a) issued when expected and b)
> not issued when not expected.  Otherwise, middle end warnings are
> known to have both false positives and false negatives in some
> invocations, depending on what optimizations are in effect.
> Indiscriminately disabling common optimizations for these large
> tests and invoking them under artificial conditions would
> compromise this goal and hide the problems.
>
> If enabling vectorization at -O2 causes regressions in the quality
> of diagnostics (as the test failure above indicates seems to be
> happening) we should investigate these and open bugs for them so
> they can be fixed.  We can then tweak the specific failing test
> cases to avoid the failures until they are fixed.
There are indeed cases of false positives and false negatives
.i.e.
// Verify warning for access to a definition with an initializer that
// initializes the one-element array member.
struct A1 a1i_1 = { 0, { 1 } };

void ga1i_1 (void)
{
  a1i_1.a[0] = 0;
  a1i_1.a[1] = 1;               // { dg-warning "\\\[-Wstringop-overflow" }
  a1i_1.a[2] = 2;               // { dg-warning "\\\[-Wstringop-overflow" }

  struct A1 a = { 0, { 1 } }; --- false positive here.
  a.a[0] = 1;
  a.a[1] = 2;                   // { dg-warning
"\\\[-Wstringop-overflow" } false negative here.
  a.a[2] = 3;                   // { dg-warning
"\\\[-Wstringop-overflow" } false negative here.
  sink (&a);
}

the last 2 warnings are missing, and there's new warning on the line
*struct A1 a = { 0, { 1 } };
>
> Martin



-- 
BR,
Hongtao

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-22 14:21         ` Martin Sebor
@ 2021-09-22 15:03           ` Martin Sebor
  2021-09-23  1:48           ` Hongtao Liu
  1 sibling, 0 replies; 39+ messages in thread
From: Martin Sebor @ 2021-09-22 15:03 UTC (permalink / raw)
  To: Hongtao Liu
  Cc: Richard Biener, Jakub Jelinek, Florian Weimer,
	Segher Boessenkool, Richard Sandiford, Premachandra.Mallappa,
	GCC Patches, Bill Schmidt, liuhongt, Joseph Myers

On 9/22/21 8:21 AM, Martin Sebor wrote:
> On 9/21/21 7:38 PM, Hongtao Liu wrote:
>> On Mon, Sep 20, 2021 at 4:13 AM Martin Sebor <msebor@gmail.com> wrote:
> ...
>>>>>> diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c 
>>>>>> b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>>>>> index 1d79930cd58..9351f7e7a1a 100644
>>>>>> --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>>>>> +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>>>>> @@ -1,7 +1,7 @@
>>>>>>    /* PR middle-end/91458 - inconsistent warning for writing past 
>>>>>> the end
>>>>>>       of an array member
>>>>>>       { dg-do compile }
>>>>>> -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
>>>>>> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf 
>>>>>> -fno-tree-vectorize" } */
>>>>>
>>>>> The testcase is large - what part requires this change?  Given the
>>>>> testcase was added for inconsistent warnings do they now become
>>>>> inconsistent again as we enable vectorization at -O2?
>>>>>
>>>>> That said, the testcase adjustments need some explaining - I suppose
>>>>> you didn't just slap -fno-tree-vectorize to all of those changing
>>>>> behavior?
>>>>>
>>>> void ga1_ (void)
>>>> {
>>>>     a1_.a[0] = 0;
>>>>     a1_.a[1] = 1;                 // { dg-warning 
>>>> "\\\[-Wstringop-overflow" }
>>>>     a1_.a[2] = 2;                 // { dg-warning 
>>>> "\\\[-Wstringop-overflow" }
>>>>
>>>>     struct A1 a;
>>>>     a.a[0] = 0;
>>>>     a.a[1] = 1;                   // { dg-warning 
>>>> "\\\[-Wstringop-overflow" }
>>>>     a.a[2] = 2;                   // { dg-warning 
>>>> "\\\[-Wstringop-overflow" }
>>>>     sink (&a);
>>>> }
>>>>
>>>> It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
>>>> there are 2 accesses, but after enabling vectorization, there's only
>>>> one access, so one warning is missing which causes the failure.
> 
> With the stores vectorized, is the warning on the correct line or
> does it point to the first store, the one that's in bounds, as
> it does with -O3?  The latter would be a regression at -O2.
> 
>>>
>>> I would find it preferable to change the test code over disabling
>>> optimizations that are on by default.  My concern is that the test
>>> would no longer exercise the default behavior.  (The same goes for
>>> the -fno-ipa-icf option.)
>> Hmm, it's a middle-end test, for some backend, it may not do
>> vectorization(it depends on TARGET_VECTOR_MODE_SUPPORTED_P and
>> relative cost model).
> 
> Yes, there are quite a few warning tests like that.  Their main
> purpose is to verify that in common GCC invocations (i.e., without
> any special options) warnings are a) issued when expected and b)
> not issued when not expected.  Otherwise, middle end warnings are
> known to have both false positives and false negatives in some
> invocations, depending on what optimizations are in effect.
> Indiscriminately disabling common optimizations for these large
> tests and invoking them under artificial conditions would
> compromise this goal and hide the problems.
> 
> If enabling vectorization at -O2 causes regressions in the quality
> of diagnostics (as the test failure above indicates seems to be
> happening) we should investigate these and open bugs for them so
> they can be fixed.  We can then tweak the specific failing test
> cases to avoid the failures until they are fixed.

To expand on the last part: in my tests with -O2 and -O3 the failure
is specific to char stores and doesn't affect stores of larger types
because they're not detected by -Wstringop-overflow.  Those accesses
are handled by -Warray-bounds.  The former runs as part of the strlen
and after vectorization, while the latter runs in vrp1 and before
vectorization.  So the "quick and dirty" solution here, to keep
the warnings on the right lines, might be to move the char store
handling from the strlen pass to vrp1.  A more robust solution is
to avoid vectorizing (or merging) out of bounds stores.

> 
> Martin


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-22  1:38       ` Hongtao Liu
@ 2021-09-22 14:21         ` Martin Sebor
  2021-09-22 15:03           ` Martin Sebor
  2021-09-23  1:48           ` Hongtao Liu
  0 siblings, 2 replies; 39+ messages in thread
From: Martin Sebor @ 2021-09-22 14:21 UTC (permalink / raw)
  To: Hongtao Liu
  Cc: Richard Biener, Jakub Jelinek, Florian Weimer,
	Segher Boessenkool, Richard Sandiford, Premachandra.Mallappa,
	GCC Patches, Bill Schmidt, liuhongt, Joseph Myers

On 9/21/21 7:38 PM, Hongtao Liu wrote:
> On Mon, Sep 20, 2021 at 4:13 AM Martin Sebor <msebor@gmail.com> wrote:
...
>>>>> diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>>>> index 1d79930cd58..9351f7e7a1a 100644
>>>>> --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>>>> +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>>>> @@ -1,7 +1,7 @@
>>>>>    /* PR middle-end/91458 - inconsistent warning for writing past the end
>>>>>       of an array member
>>>>>       { dg-do compile }
>>>>> -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
>>>>> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
>>>>
>>>> The testcase is large - what part requires this change?  Given the
>>>> testcase was added for inconsistent warnings do they now become
>>>> inconsistent again as we enable vectorization at -O2?
>>>>
>>>> That said, the testcase adjustments need some explaining - I suppose
>>>> you didn't just slap -fno-tree-vectorize to all of those changing
>>>> behavior?
>>>>
>>> void ga1_ (void)
>>> {
>>>     a1_.a[0] = 0;
>>>     a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
>>>     a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
>>>
>>>     struct A1 a;
>>>     a.a[0] = 0;
>>>     a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
>>>     a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
>>>     sink (&a);
>>> }
>>>
>>> It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
>>> there are 2 accesses, but after enabling vectorization, there's only
>>> one access, so one warning is missing which causes the failure.

With the stores vectorized, is the warning on the correct line or
does it point to the first store, the one that's in bounds, as
it does with -O3?  The latter would be a regression at -O2.

>>
>> I would find it preferable to change the test code over disabling
>> optimizations that are on by default.  My concern is that the test
>> would no longer exercise the default behavior.  (The same goes for
>> the -fno-ipa-icf option.)
> Hmm, it's a middle-end test, for some backend, it may not do
> vectorization(it depends on TARGET_VECTOR_MODE_SUPPORTED_P and
> relative cost model).

Yes, there are quite a few warning tests like that.  Their main
purpose is to verify that in common GCC invocations (i.e., without
any special options) warnings are a) issued when expected and b)
not issued when not expected.  Otherwise, middle end warnings are
known to have both false positives and false negatives in some
invocations, depending on what optimizations are in effect.
Indiscriminately disabling common optimizations for these large
tests and invoking them under artificial conditions would
compromise this goal and hide the problems.

If enabling vectorization at -O2 causes regressions in the quality
of diagnostics (as the test failure above indicates seems to be
happening) we should investigate these and open bugs for them so
they can be fixed.  We can then tweak the specific failing test
cases to avoid the failures until they are fixed.

Martin

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-19 20:13     ` Martin Sebor
@ 2021-09-22  1:38       ` Hongtao Liu
  2021-09-22 14:21         ` Martin Sebor
  0 siblings, 1 reply; 39+ messages in thread
From: Hongtao Liu @ 2021-09-22  1:38 UTC (permalink / raw)
  To: Martin Sebor
  Cc: Richard Biener, Jakub Jelinek, Florian Weimer,
	Segher Boessenkool, Richard Sandiford, Premachandra.Mallappa,
	GCC Patches, Bill Schmidt, liuhongt, Joseph Myers

On Mon, Sep 20, 2021 at 4:13 AM Martin Sebor <msebor@gmail.com> wrote:
>
> On 9/16/21 3:03 AM, Hongtao Liu via Gcc-patches wrote:
> > On Thu, Sep 16, 2021 at 4:23 PM Richard Biener via Gcc-patches
> > <gcc-patches@gcc.gnu.org> wrote:
> >>
> >> On Thu, 16 Sep 2021, liuhongt wrote:
> >>
> >>> Ping
> >>> rebased on latest trunk.
> >>>
> >>> gcc/ChangeLog:
> >>>
> >>>        * common.opt (ftree-vectorize): Add Var(flag_tree_vectorize).
> >>>        * doc/invoke.texi (Options That Control Optimization): Update
> >>>        documents.
> >>>        * opts.c (default_options_table): Enable auto-vectorization at
> >>>        O2 with very-cheap cost model.
> >>>        (finish_options): Use cheap cost model for
> >>>        explicit -ftree{,-loop}-vectorize.
> >>>
> >>> gcc/testsuite/ChangeLog:
> >>>
> >>>        * c-c++-common/Wstringop-overflow-2.c: Adjust testcase.
> >>>        * g++.dg/tree-ssa/pr81408.C: Ditto.
> >>>        * g++.dg/warn/Wuninitialized-13.C: Ditto.
> >>>        * gcc.dg/Warray-bounds-51.c: Ditto.
> >>>        * gcc.dg/Warray-parameter-3.c: Ditto.
> >>>        * gcc.dg/Wstringop-overflow-13.c: Ditto.
> >>>        * gcc.dg/Wstringop-overflow-14.c: Ditto.
> >>>        * gcc.dg/Wstringop-overflow-21.c: Ditto.
> >>>        * gcc.dg/Wstringop-overflow-68.c: Ditto.
> >>>        * gcc.dg/gomp/pr46032-2.c: Ditto.
> >>>        * gcc.dg/gomp/pr46032-3.c: Ditto.
> >>>        * gcc.dg/gomp/simd-2.c: Ditto.
> >>>        * gcc.dg/gomp/simd-3.c: Ditto.
> >>>        * gcc.dg/graphite/fuse-1.c: Ditto.
> >>>        * gcc.dg/pr67089-6.c: Ditto.
> >>>        * gcc.dg/pr82929-2.c: Ditto.
> >>>        * gcc.dg/pr82929.c: Ditto.
> >>>        * gcc.dg/store_merging_1.c: Ditto.
> >>>        * gcc.dg/store_merging_11.c: Ditto.
> >>>        * gcc.dg/store_merging_15.c: Ditto.
> >>>        * gcc.dg/store_merging_16.c: Ditto.
> >>>        * gcc.dg/store_merging_19.c: Ditto.
> >>>        * gcc.dg/store_merging_24.c: Ditto.
> >>>        * gcc.dg/store_merging_25.c: Ditto.
> >>>        * gcc.dg/store_merging_28.c: Ditto.
> >>>        * gcc.dg/store_merging_30.c: Ditto.
> >>>        * gcc.dg/store_merging_5.c: Ditto.
> >>>        * gcc.dg/store_merging_7.c: Ditto.
> >>>        * gcc.dg/store_merging_8.c: Ditto.
> >>>        * gcc.dg/strlenopt-85.c: Ditto.
> >>>        * gcc.dg/tree-ssa/dump-6.c: Ditto.
> >>>        * gcc.dg/tree-ssa/pr19210-1.c: Ditto.
> >>>        * gcc.dg/tree-ssa/pr47059.c: Ditto.
> >>>        * gcc.dg/tree-ssa/pr86017.c: Ditto.
> >>>        * gcc.dg/tree-ssa/pr91482.c: Ditto.
> >>>        * gcc.dg/tree-ssa/predcom-1.c: Ditto.
> >>>        * gcc.dg/tree-ssa/predcom-dse-3.c: Ditto.
> >>>        * gcc.dg/tree-ssa/prefetch-3.c: Ditto.
> >>>        * gcc.dg/tree-ssa/prefetch-6.c: Ditto.
> >>>        * gcc.dg/tree-ssa/prefetch-8.c: Ditto.
> >>>        * gcc.dg/tree-ssa/prefetch-9.c: Ditto.
> >>>        * gcc.dg/tree-ssa/ssa-dse-18.c: Ditto.
> >>>        * gcc.dg/tree-ssa/ssa-dse-19.c: Ditto.
> >>>        * gcc.dg/uninit-40.c: Ditto.
> >>>        * gcc.dg/unroll-7.c: Ditto.
> >>>        * gcc.misc-tests/help.exp: Ditto.
> >>>        * gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
> >>>        * gcc.target/i386/pr22141.c: Ditto.
> >>>        * gcc.target/i386/pr34012.c: Ditto.
> >>>        * gcc.target/i386/pr49781-1.c: Ditto.
> >>>        * gcc.target/i386/pr95798-1.c: Ditto.
> >>>        * gcc.target/i386/pr95798-2.c: Ditto.
> >>>        * gfortran.dg/pr77498.f: Ditto.
> >>> ---
> >>>   gcc/common.opt                                 |  2 +-
> >>>   gcc/doc/invoke.texi                            |  8 +++++---
> >>>   gcc/opts.c                                     | 18 +++++++++++++++---
> >>>   .../c-c++-common/Wstringop-overflow-2.c        |  2 +-
> >>>   gcc/testsuite/g++.dg/tree-ssa/pr81408.C        |  2 +-
> >>>   gcc/testsuite/g++.dg/warn/Wuninitialized-13.C  |  2 +-
> >>>   gcc/testsuite/gcc.dg/Warray-bounds-51.c        |  2 +-
> >>>   gcc/testsuite/gcc.dg/Warray-parameter-3.c      |  2 +-
> >>>   gcc/testsuite/gcc.dg/Wstringop-overflow-13.c   |  2 +-
> >>>   gcc/testsuite/gcc.dg/Wstringop-overflow-14.c   |  2 +-
> >>>   gcc/testsuite/gcc.dg/Wstringop-overflow-21.c   |  2 +-
> >>>   gcc/testsuite/gcc.dg/Wstringop-overflow-68.c   |  2 +-
> >>>   gcc/testsuite/gcc.dg/gomp/pr46032-2.c          |  2 +-
> >>>   gcc/testsuite/gcc.dg/gomp/pr46032-3.c          |  2 +-
> >>>   gcc/testsuite/gcc.dg/gomp/simd-2.c             |  2 +-
> >>>   gcc/testsuite/gcc.dg/gomp/simd-3.c             |  2 +-
> >>>   gcc/testsuite/gcc.dg/graphite/fuse-1.c         |  2 +-
> >>>   gcc/testsuite/gcc.dg/pr67089-6.c               |  2 +-
> >>>   gcc/testsuite/gcc.dg/pr82929-2.c               |  2 +-
> >>>   gcc/testsuite/gcc.dg/pr82929.c                 |  2 +-
> >>>   gcc/testsuite/gcc.dg/store_merging_1.c         |  2 +-
> >>>   gcc/testsuite/gcc.dg/store_merging_11.c        |  2 +-
> >>>   gcc/testsuite/gcc.dg/store_merging_15.c        |  2 +-
> >>>   gcc/testsuite/gcc.dg/store_merging_16.c        |  2 +-
> >>>   gcc/testsuite/gcc.dg/store_merging_19.c        |  2 +-
> >>>   gcc/testsuite/gcc.dg/store_merging_24.c        |  2 +-
> >>>   gcc/testsuite/gcc.dg/store_merging_25.c        |  2 +-
> >>>   gcc/testsuite/gcc.dg/store_merging_28.c        |  2 +-
> >>>   gcc/testsuite/gcc.dg/store_merging_30.c        |  2 +-
> >>>   gcc/testsuite/gcc.dg/store_merging_5.c         |  2 +-
> >>>   gcc/testsuite/gcc.dg/store_merging_7.c         |  2 +-
> >>>   gcc/testsuite/gcc.dg/store_merging_8.c         |  2 +-
> >>>   gcc/testsuite/gcc.dg/strlenopt-85.c            |  2 +-
> >>>   gcc/testsuite/gcc.dg/tree-ssa/dump-6.c         |  2 +-
> >>>   gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c      |  2 +-
> >>>   gcc/testsuite/gcc.dg/tree-ssa/pr47059.c        |  2 +-
> >>>   gcc/testsuite/gcc.dg/tree-ssa/pr86017.c        |  2 +-
> >>>   gcc/testsuite/gcc.dg/tree-ssa/pr91482.c        |  2 +-
> >>>   gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c      |  2 +-
> >>>   gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c  |  2 +-
> >>>   gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c     |  2 +-
> >>>   gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c     |  2 +-
> >>>   gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c     |  2 +-
> >>>   gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c     |  2 +-
> >>>   gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c     |  2 +-
> >>>   gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c     |  2 +-
> >>>   gcc/testsuite/gcc.dg/uninit-40.c               |  2 +-
> >>>   gcc/testsuite/gcc.dg/unroll-7.c                |  2 +-
> >>>   gcc/testsuite/gcc.misc-tests/help.exp          |  2 +-
> >>>   .../i386/avx512vpopcntdqvl-vpopcntd-1.c        |  2 +-
> >>>   gcc/testsuite/gcc.target/i386/pr22141.c        |  2 +-
> >>>   gcc/testsuite/gcc.target/i386/pr34012.c        |  2 +-
> >>>   gcc/testsuite/gcc.target/i386/pr49781-1.c      |  2 +-
> >>>   gcc/testsuite/gcc.target/i386/pr95798-1.c      |  2 +-
> >>>   gcc/testsuite/gcc.target/i386/pr95798-2.c      |  2 +-
> >>>   gcc/testsuite/gfortran.dg/pr77498.f            |  2 +-
> >>>   56 files changed, 74 insertions(+), 60 deletions(-)
> >>>
> >>> diff --git a/gcc/common.opt b/gcc/common.opt
> >>> index b921f5e3b25..4f2c0294c29 100644
> >>> --- a/gcc/common.opt
> >>> +++ b/gcc/common.opt
> >>> @@ -3031,7 +3031,7 @@ Perform variable tracking and also tag variables that are uninitialized.
> >>>
> >>>   ; 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/doc/invoke.texi b/gcc/doc/invoke.texi
> >>> index 78cfc100ac2..be022ef8024 100644
> >>> --- a/gcc/doc/invoke.texi
> >>> +++ b/gcc/doc/invoke.texi
> >>> @@ -10409,9 +10409,13 @@ also turns on the following optimization flags:
> >>>   -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 @gol
> >>
> >> the above is redundant
> >>
> >>> +-fvect-cost-model=very-cheap}
> >>>
> >>>   Please note the warning under @option{-fgcse} about
> >>>   invoking @option{-O2} on programs that use computed gotos.
> >>> @@ -10431,9 +10435,7 @@ by @option{-O2} and also turns on the following optimization flags:
> >>>   -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
> >>
> >> likewise - so just remove it here as you are around
> >>
> >>>   -fvect-cost-model=dynamic @gol
> >>> diff --git a/gcc/opts.c b/gcc/opts.c
> >>> index 1d2d22d7a3f..cee372a3235 100644
> >>> --- a/gcc/opts.c
> >>> +++ b/gcc/opts.c
> >>> @@ -634,7 +634,8 @@ static const struct default_options default_options_table[] =
> >>>       { 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,9 @@ static const struct default_options default_options_table[] =
> >>>       { 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 +667,7 @@ static const struct default_options default_options_table[] =
> >>>       { 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 },
> >>> @@ -1331,6 +1333,16 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
> >>>         = (opts->x_flag_unroll_loops
> >>>            || opts->x_flag_peel_loops
> >>>            || opts->x_optimize >= 3);
> >>> +
> >>> +  /* 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);
> >>> +
> >>> +
> >>
> >> please avoid adding excessive vertical space at the end of the function
> >>
> >>>   }
> >>>
> >>>   #define LEFT_COLUMN  27
> >>> diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> >>> index 1d79930cd58..9351f7e7a1a 100644
> >>> --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> >>> +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> >>> @@ -1,7 +1,7 @@
> >>>   /* PR middle-end/91458 - inconsistent warning for writing past the end
> >>>      of an array member
> >>>      { dg-do compile }
> >>> -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
> >>> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
> >>
> >> The testcase is large - what part requires this change?  Given the
> >> testcase was added for inconsistent warnings do they now become
> >> inconsistent again as we enable vectorization at -O2?
> >>
> >> That said, the testcase adjustments need some explaining - I suppose
> >> you didn't just slap -fno-tree-vectorize to all of those changing
> >> behavior?
> >>
> > void ga1_ (void)
> > {
> >    a1_.a[0] = 0;
> >    a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
> >    a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
> >
> >    struct A1 a;
> >    a.a[0] = 0;
> >    a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
> >    a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
> >    sink (&a);
> > }
> >
> > It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
> > there are 2 accesses, but after enabling vectorization, there's only
> > one access, so one warning is missing which causes the failure.
>
> I would find it preferable to change the test code over disabling
> optimizations that are on by default.  My concern is that the test
> would no longer exercise the default behavior.  (The same goes for
> the -fno-ipa-icf option.)
Hmm, it's a middle-end test, for some backend, it may not do
vectorization(it depends on TARGET_VECTOR_MODE_SUPPORTED_P and
relative cost model).
>
> Thanks
> Martin
>
> >
> >     <bb 2> [local count: 1073741824]:
> >    a1__.a[0] = 0;
> >    a1__.a[1] = 1;
> >    a1__.a[2] = 2;
> >    MEM <char[1]> [(struct A1 *)&a + 1B] = {};
> >    a.n = 1;
> >    MEM <vector(2) char> [(char *)&a + 2B] = { 1, 2 };
> >    sink (&a);
> >    a ={v} {CLOBBER};
> >    return;
> >
> >
> >> Thanks,
> >> Richard.
> >>
> >>>   void sink (void*);
> >>>
> >>> diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
> >>> index 39e32fd4bc9..bc14309480c 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 49ee878806a..60e8dd4f0e2 100644
> >>> --- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> >>> +++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> >>> @@ -1,6 +1,6 @@
> >>>   /* PR c/98597 - ICE in -Wuninitialized printing a MEM_REF
> >>>      { dg-do compile }
> >>> -   { dg-options "-O2 -Wall" } */
> >>> +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> >>>
> >>>   struct shared_count {
> >>>     shared_count () { }
> >>> diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-51.c b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> >>> index 6028b11637c..8b81a0ccfa7 100644
> >>> --- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> >>> +++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> >>> @@ -1,7 +1,7 @@
> >>>   /* PR middle-end/92333 - missing variable name referencing VLA in warnings
> >>>      PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
> >>>      { dg-do compile }
> >>> -   { dg-options "-O2 -Wall" } */
> >>> +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> >>>
> >>>   void sink (void*);
> >>>
> >>> diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-3.c b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> >>> index cbf3e9339f5..fbef715aa99 100644
> >>> --- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> >>> +++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> >>> @@ -59,7 +59,7 @@ void fas1 (int[static 2]);    // { dg-warning "\\\[-Warray-parameter=" }
> >>>
> >>>   /* Also verify that -Warray-bounds doesn't trigger for ordinary array
> >>>      parameters...  */
> >>> -#pragma GCC optimize "2"
> >>> +#pragma GCC optimize ("2,-fno-tree-vectorize")
> >>>
> >>>   __attribute__ ((noipa)) void
> >>>   gca3 (char a[3])
> >>> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> >>> index bd513151cea..a78242bf26e 100644
> >>> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> >>> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> >>> @@ -3,7 +3,7 @@
> >>>      PR middle-end/89911 - ICE on a call with no arguments to strnlen
> >>>      declared with no prototype
> >>>      { dg-do compile }
> >>> -   { dg-options "-O2 -Wall" } */
> >>> +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> >>>
> >>>   typedef __SIZE_TYPE__ size_t;
> >>>
> >>> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> >>> index d6201b068b6..808bf87c386 100644
> >>> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> >>> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> >>> @@ -2,7 +2,7 @@
> >>>      types than char are diagnosed.
> >>>      { dg-do compile }
> >>>      { dg-require-effective-target int32plus }
> >>> -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> >>> +   { dg-options "-O2 -fno-tree-vectorize -Wall -Wno-array-bounds" } */
> >>>
> >>>   typedef __INT16_TYPE__  int16_t;
> >>>   typedef __INT32_TYPE__  int32_t;
> >>> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> >>> index 3a27460220c..f418a17ca93 100644
> >>> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> >>> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> >>> @@ -1,7 +1,7 @@
> >>>   /* PR middle-end/92312 - bogus -Wstringop-overflow storing into a trailing
> >>>      array backed by larger buffer
> >>>      { dg-do compile }
> >>> -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> >>> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-tree-vectorize" } */
> >>>
> >>>   struct S0 { char a, b[0]; };
> >>>
> >>> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> >>> index 6bcba274541..7cc1012130c 100644
> >>> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> >>> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> >>> @@ -2,7 +2,7 @@
> >>>      a larger scalar into a smaller array
> >>>      Verify overflow by aggregate stores.
> >>>      { dg-do compile }
> >>> -   { dg-options "-O2" } */
> >>> +   { dg-options "-O2 -fno-tree-vectorize" } */
> >>>
> >>>   #define A(N) (A ## N)
> >>>   #define Ac1 (AC1){ 0 }
> >>> diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
> >>> index e110880bd8e..2e562618489 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 a4af7ec4a8a..da1ab487385 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 85acb980f10..f4912127b81 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 86fee858673..c75060c07ae 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 527b6e5c415..61289d312c2 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 db2ffdfeca4..b59d75b2318 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 3442f91af02..b886f1cce76 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 bb84f2b21a3..123e1919cec 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 4cc43dfd9e1..91ca925be0e 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 2ec2394afb9..60ed5cd8bf9 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_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
> >>> index acd7de571f8..13fcca4aa11 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 9545dcce3de..cd83f1c0fe5 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 0841bb4deee..0a2bbc4bfde 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 744fe60e8e0..5291bb9e986 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 cf182190e91..96611b5e57b 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 2d6cffc4694..fadb7fff993 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 694d560a621..baf94efe733 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 6e7c72510ff..b0cb0da78e0 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 c744ece6407..dbe000a463e 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 e710a544ff0..d719e0a2257 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 e049e0c30e0..2ba1ee05700 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 70659c00c0e..6c803908781 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 50d86a00485..b9e40e964c1 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 9f9c61aa213..860cde12c0f 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 f216e83c7b3..c7ef73ad59e 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 7d6a724e4ad..0ddad573129 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 f68be2b3379..8c3d9a4fc58 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 ec08d6c0318..1fc8f089345 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 467903bf3fc..46f0d0c2317 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 12f09016943..3fa71685ace 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 cbd6a80d345..00f41c3e4f4 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 da4847320b1..e8848c30acc 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 92b2df80ec8..2e7b5b496ea 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 718b7466e50..7bb8d060631 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 c015191ca32..8708079d397 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 055369bf8b1..695af5757cc 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 5e034d26947..eb6d8686c6a 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=target,optimizers" "" "" ""
> >>>   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 709cd21e671..a732bc466db 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/pr22141.c b/gcc/testsuite/gcc.target/i386/pr22141.c
> >>> index 036422e8ccf..b68b97f3f72 100644
> >>> --- a/gcc/testsuite/gcc.target/i386/pr22141.c
> >>> +++ b/gcc/testsuite/gcc.target/i386/pr22141.c
> >>> @@ -1,6 +1,6 @@
> >>>   /* PR middle-end/22141 */
> >>>   /* { dg-do compile } */
> >>> -/* { dg-options "-Os" } */
> >>> +/* { dg-options "-Os -fno-tree-vectorize" } */
> >>>
> >>>   extern void abort (void);
> >>>
> >>> diff --git a/gcc/testsuite/gcc.target/i386/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
> >>> index d0cffa05290..1c1f0eea52e 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 60f9d50d866..d5a2e32db97 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 9a7e32d6f2f..526f48921fd 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 c670d3780e8..6b5c5a73e96 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 f957b57bb00..a0fc8275a84 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
> >>>
> >>
> >> --
> >> Richard Biener <rguenther@suse.de>
> >> SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
> >> Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)
> >
> >
> >
>


-- 
BR,
Hongtao

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-16  9:03   ` Hongtao Liu
  2021-09-16 12:31     ` Richard Biener
@ 2021-09-19 20:13     ` Martin Sebor
  2021-09-22  1:38       ` Hongtao Liu
  1 sibling, 1 reply; 39+ messages in thread
From: Martin Sebor @ 2021-09-19 20:13 UTC (permalink / raw)
  To: Hongtao Liu, Richard Biener
  Cc: Jakub Jelinek, Florian Weimer, Segher Boessenkool,
	Richard Sandiford, Premachandra.Mallappa, GCC Patches,
	Bill Schmidt, liuhongt, Joseph Myers

On 9/16/21 3:03 AM, Hongtao Liu via Gcc-patches wrote:
> On Thu, Sep 16, 2021 at 4:23 PM Richard Biener via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
>>
>> On Thu, 16 Sep 2021, liuhongt wrote:
>>
>>> Ping
>>> rebased on latest trunk.
>>>
>>> gcc/ChangeLog:
>>>
>>>        * common.opt (ftree-vectorize): Add Var(flag_tree_vectorize).
>>>        * doc/invoke.texi (Options That Control Optimization): Update
>>>        documents.
>>>        * opts.c (default_options_table): Enable auto-vectorization at
>>>        O2 with very-cheap cost model.
>>>        (finish_options): Use cheap cost model for
>>>        explicit -ftree{,-loop}-vectorize.
>>>
>>> gcc/testsuite/ChangeLog:
>>>
>>>        * c-c++-common/Wstringop-overflow-2.c: Adjust testcase.
>>>        * g++.dg/tree-ssa/pr81408.C: Ditto.
>>>        * g++.dg/warn/Wuninitialized-13.C: Ditto.
>>>        * gcc.dg/Warray-bounds-51.c: Ditto.
>>>        * gcc.dg/Warray-parameter-3.c: Ditto.
>>>        * gcc.dg/Wstringop-overflow-13.c: Ditto.
>>>        * gcc.dg/Wstringop-overflow-14.c: Ditto.
>>>        * gcc.dg/Wstringop-overflow-21.c: Ditto.
>>>        * gcc.dg/Wstringop-overflow-68.c: Ditto.
>>>        * gcc.dg/gomp/pr46032-2.c: Ditto.
>>>        * gcc.dg/gomp/pr46032-3.c: Ditto.
>>>        * gcc.dg/gomp/simd-2.c: Ditto.
>>>        * gcc.dg/gomp/simd-3.c: Ditto.
>>>        * gcc.dg/graphite/fuse-1.c: Ditto.
>>>        * gcc.dg/pr67089-6.c: Ditto.
>>>        * gcc.dg/pr82929-2.c: Ditto.
>>>        * gcc.dg/pr82929.c: Ditto.
>>>        * gcc.dg/store_merging_1.c: Ditto.
>>>        * gcc.dg/store_merging_11.c: Ditto.
>>>        * gcc.dg/store_merging_15.c: Ditto.
>>>        * gcc.dg/store_merging_16.c: Ditto.
>>>        * gcc.dg/store_merging_19.c: Ditto.
>>>        * gcc.dg/store_merging_24.c: Ditto.
>>>        * gcc.dg/store_merging_25.c: Ditto.
>>>        * gcc.dg/store_merging_28.c: Ditto.
>>>        * gcc.dg/store_merging_30.c: Ditto.
>>>        * gcc.dg/store_merging_5.c: Ditto.
>>>        * gcc.dg/store_merging_7.c: Ditto.
>>>        * gcc.dg/store_merging_8.c: Ditto.
>>>        * gcc.dg/strlenopt-85.c: Ditto.
>>>        * gcc.dg/tree-ssa/dump-6.c: Ditto.
>>>        * gcc.dg/tree-ssa/pr19210-1.c: Ditto.
>>>        * gcc.dg/tree-ssa/pr47059.c: Ditto.
>>>        * gcc.dg/tree-ssa/pr86017.c: Ditto.
>>>        * gcc.dg/tree-ssa/pr91482.c: Ditto.
>>>        * gcc.dg/tree-ssa/predcom-1.c: Ditto.
>>>        * gcc.dg/tree-ssa/predcom-dse-3.c: Ditto.
>>>        * gcc.dg/tree-ssa/prefetch-3.c: Ditto.
>>>        * gcc.dg/tree-ssa/prefetch-6.c: Ditto.
>>>        * gcc.dg/tree-ssa/prefetch-8.c: Ditto.
>>>        * gcc.dg/tree-ssa/prefetch-9.c: Ditto.
>>>        * gcc.dg/tree-ssa/ssa-dse-18.c: Ditto.
>>>        * gcc.dg/tree-ssa/ssa-dse-19.c: Ditto.
>>>        * gcc.dg/uninit-40.c: Ditto.
>>>        * gcc.dg/unroll-7.c: Ditto.
>>>        * gcc.misc-tests/help.exp: Ditto.
>>>        * gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
>>>        * gcc.target/i386/pr22141.c: Ditto.
>>>        * gcc.target/i386/pr34012.c: Ditto.
>>>        * gcc.target/i386/pr49781-1.c: Ditto.
>>>        * gcc.target/i386/pr95798-1.c: Ditto.
>>>        * gcc.target/i386/pr95798-2.c: Ditto.
>>>        * gfortran.dg/pr77498.f: Ditto.
>>> ---
>>>   gcc/common.opt                                 |  2 +-
>>>   gcc/doc/invoke.texi                            |  8 +++++---
>>>   gcc/opts.c                                     | 18 +++++++++++++++---
>>>   .../c-c++-common/Wstringop-overflow-2.c        |  2 +-
>>>   gcc/testsuite/g++.dg/tree-ssa/pr81408.C        |  2 +-
>>>   gcc/testsuite/g++.dg/warn/Wuninitialized-13.C  |  2 +-
>>>   gcc/testsuite/gcc.dg/Warray-bounds-51.c        |  2 +-
>>>   gcc/testsuite/gcc.dg/Warray-parameter-3.c      |  2 +-
>>>   gcc/testsuite/gcc.dg/Wstringop-overflow-13.c   |  2 +-
>>>   gcc/testsuite/gcc.dg/Wstringop-overflow-14.c   |  2 +-
>>>   gcc/testsuite/gcc.dg/Wstringop-overflow-21.c   |  2 +-
>>>   gcc/testsuite/gcc.dg/Wstringop-overflow-68.c   |  2 +-
>>>   gcc/testsuite/gcc.dg/gomp/pr46032-2.c          |  2 +-
>>>   gcc/testsuite/gcc.dg/gomp/pr46032-3.c          |  2 +-
>>>   gcc/testsuite/gcc.dg/gomp/simd-2.c             |  2 +-
>>>   gcc/testsuite/gcc.dg/gomp/simd-3.c             |  2 +-
>>>   gcc/testsuite/gcc.dg/graphite/fuse-1.c         |  2 +-
>>>   gcc/testsuite/gcc.dg/pr67089-6.c               |  2 +-
>>>   gcc/testsuite/gcc.dg/pr82929-2.c               |  2 +-
>>>   gcc/testsuite/gcc.dg/pr82929.c                 |  2 +-
>>>   gcc/testsuite/gcc.dg/store_merging_1.c         |  2 +-
>>>   gcc/testsuite/gcc.dg/store_merging_11.c        |  2 +-
>>>   gcc/testsuite/gcc.dg/store_merging_15.c        |  2 +-
>>>   gcc/testsuite/gcc.dg/store_merging_16.c        |  2 +-
>>>   gcc/testsuite/gcc.dg/store_merging_19.c        |  2 +-
>>>   gcc/testsuite/gcc.dg/store_merging_24.c        |  2 +-
>>>   gcc/testsuite/gcc.dg/store_merging_25.c        |  2 +-
>>>   gcc/testsuite/gcc.dg/store_merging_28.c        |  2 +-
>>>   gcc/testsuite/gcc.dg/store_merging_30.c        |  2 +-
>>>   gcc/testsuite/gcc.dg/store_merging_5.c         |  2 +-
>>>   gcc/testsuite/gcc.dg/store_merging_7.c         |  2 +-
>>>   gcc/testsuite/gcc.dg/store_merging_8.c         |  2 +-
>>>   gcc/testsuite/gcc.dg/strlenopt-85.c            |  2 +-
>>>   gcc/testsuite/gcc.dg/tree-ssa/dump-6.c         |  2 +-
>>>   gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c      |  2 +-
>>>   gcc/testsuite/gcc.dg/tree-ssa/pr47059.c        |  2 +-
>>>   gcc/testsuite/gcc.dg/tree-ssa/pr86017.c        |  2 +-
>>>   gcc/testsuite/gcc.dg/tree-ssa/pr91482.c        |  2 +-
>>>   gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c      |  2 +-
>>>   gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c  |  2 +-
>>>   gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c     |  2 +-
>>>   gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c     |  2 +-
>>>   gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c     |  2 +-
>>>   gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c     |  2 +-
>>>   gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c     |  2 +-
>>>   gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c     |  2 +-
>>>   gcc/testsuite/gcc.dg/uninit-40.c               |  2 +-
>>>   gcc/testsuite/gcc.dg/unroll-7.c                |  2 +-
>>>   gcc/testsuite/gcc.misc-tests/help.exp          |  2 +-
>>>   .../i386/avx512vpopcntdqvl-vpopcntd-1.c        |  2 +-
>>>   gcc/testsuite/gcc.target/i386/pr22141.c        |  2 +-
>>>   gcc/testsuite/gcc.target/i386/pr34012.c        |  2 +-
>>>   gcc/testsuite/gcc.target/i386/pr49781-1.c      |  2 +-
>>>   gcc/testsuite/gcc.target/i386/pr95798-1.c      |  2 +-
>>>   gcc/testsuite/gcc.target/i386/pr95798-2.c      |  2 +-
>>>   gcc/testsuite/gfortran.dg/pr77498.f            |  2 +-
>>>   56 files changed, 74 insertions(+), 60 deletions(-)
>>>
>>> diff --git a/gcc/common.opt b/gcc/common.opt
>>> index b921f5e3b25..4f2c0294c29 100644
>>> --- a/gcc/common.opt
>>> +++ b/gcc/common.opt
>>> @@ -3031,7 +3031,7 @@ Perform variable tracking and also tag variables that are uninitialized.
>>>
>>>   ; 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/doc/invoke.texi b/gcc/doc/invoke.texi
>>> index 78cfc100ac2..be022ef8024 100644
>>> --- a/gcc/doc/invoke.texi
>>> +++ b/gcc/doc/invoke.texi
>>> @@ -10409,9 +10409,13 @@ also turns on the following optimization flags:
>>>   -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 @gol
>>
>> the above is redundant
>>
>>> +-fvect-cost-model=very-cheap}
>>>
>>>   Please note the warning under @option{-fgcse} about
>>>   invoking @option{-O2} on programs that use computed gotos.
>>> @@ -10431,9 +10435,7 @@ by @option{-O2} and also turns on the following optimization flags:
>>>   -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
>>
>> likewise - so just remove it here as you are around
>>
>>>   -fvect-cost-model=dynamic @gol
>>> diff --git a/gcc/opts.c b/gcc/opts.c
>>> index 1d2d22d7a3f..cee372a3235 100644
>>> --- a/gcc/opts.c
>>> +++ b/gcc/opts.c
>>> @@ -634,7 +634,8 @@ static const struct default_options default_options_table[] =
>>>       { 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,9 @@ static const struct default_options default_options_table[] =
>>>       { 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 +667,7 @@ static const struct default_options default_options_table[] =
>>>       { 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 },
>>> @@ -1331,6 +1333,16 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
>>>         = (opts->x_flag_unroll_loops
>>>            || opts->x_flag_peel_loops
>>>            || opts->x_optimize >= 3);
>>> +
>>> +  /* 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);
>>> +
>>> +
>>
>> please avoid adding excessive vertical space at the end of the function
>>
>>>   }
>>>
>>>   #define LEFT_COLUMN  27
>>> diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>> index 1d79930cd58..9351f7e7a1a 100644
>>> --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>> +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
>>> @@ -1,7 +1,7 @@
>>>   /* PR middle-end/91458 - inconsistent warning for writing past the end
>>>      of an array member
>>>      { dg-do compile }
>>> -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
>>> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
>>
>> The testcase is large - what part requires this change?  Given the
>> testcase was added for inconsistent warnings do they now become
>> inconsistent again as we enable vectorization at -O2?
>>
>> That said, the testcase adjustments need some explaining - I suppose
>> you didn't just slap -fno-tree-vectorize to all of those changing
>> behavior?
>>
> void ga1_ (void)
> {
>    a1_.a[0] = 0;
>    a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
>    a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
> 
>    struct A1 a;
>    a.a[0] = 0;
>    a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
>    a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
>    sink (&a);
> }
> 
> It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
> there are 2 accesses, but after enabling vectorization, there's only
> one access, so one warning is missing which causes the failure.

I would find it preferable to change the test code over disabling
optimizations that are on by default.  My concern is that the test
would no longer exercise the default behavior.  (The same goes for
the -fno-ipa-icf option.)

Thanks
Martin

> 
>     <bb 2> [local count: 1073741824]:
>    a1__.a[0] = 0;
>    a1__.a[1] = 1;
>    a1__.a[2] = 2;
>    MEM <char[1]> [(struct A1 *)&a + 1B] = {};
>    a.n = 1;
>    MEM <vector(2) char> [(char *)&a + 2B] = { 1, 2 };
>    sink (&a);
>    a ={v} {CLOBBER};
>    return;
> 
> 
>> Thanks,
>> Richard.
>>
>>>   void sink (void*);
>>>
>>> diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
>>> index 39e32fd4bc9..bc14309480c 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 49ee878806a..60e8dd4f0e2 100644
>>> --- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
>>> +++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
>>> @@ -1,6 +1,6 @@
>>>   /* PR c/98597 - ICE in -Wuninitialized printing a MEM_REF
>>>      { dg-do compile }
>>> -   { dg-options "-O2 -Wall" } */
>>> +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
>>>
>>>   struct shared_count {
>>>     shared_count () { }
>>> diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-51.c b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
>>> index 6028b11637c..8b81a0ccfa7 100644
>>> --- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
>>> +++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
>>> @@ -1,7 +1,7 @@
>>>   /* PR middle-end/92333 - missing variable name referencing VLA in warnings
>>>      PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
>>>      { dg-do compile }
>>> -   { dg-options "-O2 -Wall" } */
>>> +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
>>>
>>>   void sink (void*);
>>>
>>> diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-3.c b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
>>> index cbf3e9339f5..fbef715aa99 100644
>>> --- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
>>> +++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
>>> @@ -59,7 +59,7 @@ void fas1 (int[static 2]);    // { dg-warning "\\\[-Warray-parameter=" }
>>>
>>>   /* Also verify that -Warray-bounds doesn't trigger for ordinary array
>>>      parameters...  */
>>> -#pragma GCC optimize "2"
>>> +#pragma GCC optimize ("2,-fno-tree-vectorize")
>>>
>>>   __attribute__ ((noipa)) void
>>>   gca3 (char a[3])
>>> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
>>> index bd513151cea..a78242bf26e 100644
>>> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
>>> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
>>> @@ -3,7 +3,7 @@
>>>      PR middle-end/89911 - ICE on a call with no arguments to strnlen
>>>      declared with no prototype
>>>      { dg-do compile }
>>> -   { dg-options "-O2 -Wall" } */
>>> +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
>>>
>>>   typedef __SIZE_TYPE__ size_t;
>>>
>>> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
>>> index d6201b068b6..808bf87c386 100644
>>> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
>>> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
>>> @@ -2,7 +2,7 @@
>>>      types than char are diagnosed.
>>>      { dg-do compile }
>>>      { dg-require-effective-target int32plus }
>>> -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
>>> +   { dg-options "-O2 -fno-tree-vectorize -Wall -Wno-array-bounds" } */
>>>
>>>   typedef __INT16_TYPE__  int16_t;
>>>   typedef __INT32_TYPE__  int32_t;
>>> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
>>> index 3a27460220c..f418a17ca93 100644
>>> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
>>> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
>>> @@ -1,7 +1,7 @@
>>>   /* PR middle-end/92312 - bogus -Wstringop-overflow storing into a trailing
>>>      array backed by larger buffer
>>>      { dg-do compile }
>>> -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
>>> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-tree-vectorize" } */
>>>
>>>   struct S0 { char a, b[0]; };
>>>
>>> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
>>> index 6bcba274541..7cc1012130c 100644
>>> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
>>> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
>>> @@ -2,7 +2,7 @@
>>>      a larger scalar into a smaller array
>>>      Verify overflow by aggregate stores.
>>>      { dg-do compile }
>>> -   { dg-options "-O2" } */
>>> +   { dg-options "-O2 -fno-tree-vectorize" } */
>>>
>>>   #define A(N) (A ## N)
>>>   #define Ac1 (AC1){ 0 }
>>> diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
>>> index e110880bd8e..2e562618489 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 a4af7ec4a8a..da1ab487385 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 85acb980f10..f4912127b81 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 86fee858673..c75060c07ae 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 527b6e5c415..61289d312c2 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 db2ffdfeca4..b59d75b2318 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 3442f91af02..b886f1cce76 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 bb84f2b21a3..123e1919cec 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 4cc43dfd9e1..91ca925be0e 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 2ec2394afb9..60ed5cd8bf9 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_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
>>> index acd7de571f8..13fcca4aa11 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 9545dcce3de..cd83f1c0fe5 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 0841bb4deee..0a2bbc4bfde 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 744fe60e8e0..5291bb9e986 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 cf182190e91..96611b5e57b 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 2d6cffc4694..fadb7fff993 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 694d560a621..baf94efe733 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 6e7c72510ff..b0cb0da78e0 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 c744ece6407..dbe000a463e 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 e710a544ff0..d719e0a2257 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 e049e0c30e0..2ba1ee05700 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 70659c00c0e..6c803908781 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 50d86a00485..b9e40e964c1 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 9f9c61aa213..860cde12c0f 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 f216e83c7b3..c7ef73ad59e 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 7d6a724e4ad..0ddad573129 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 f68be2b3379..8c3d9a4fc58 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 ec08d6c0318..1fc8f089345 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 467903bf3fc..46f0d0c2317 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 12f09016943..3fa71685ace 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 cbd6a80d345..00f41c3e4f4 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 da4847320b1..e8848c30acc 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 92b2df80ec8..2e7b5b496ea 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 718b7466e50..7bb8d060631 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 c015191ca32..8708079d397 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 055369bf8b1..695af5757cc 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 5e034d26947..eb6d8686c6a 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=target,optimizers" "" "" ""
>>>   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 709cd21e671..a732bc466db 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/pr22141.c b/gcc/testsuite/gcc.target/i386/pr22141.c
>>> index 036422e8ccf..b68b97f3f72 100644
>>> --- a/gcc/testsuite/gcc.target/i386/pr22141.c
>>> +++ b/gcc/testsuite/gcc.target/i386/pr22141.c
>>> @@ -1,6 +1,6 @@
>>>   /* PR middle-end/22141 */
>>>   /* { dg-do compile } */
>>> -/* { dg-options "-Os" } */
>>> +/* { dg-options "-Os -fno-tree-vectorize" } */
>>>
>>>   extern void abort (void);
>>>
>>> diff --git a/gcc/testsuite/gcc.target/i386/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
>>> index d0cffa05290..1c1f0eea52e 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 60f9d50d866..d5a2e32db97 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 9a7e32d6f2f..526f48921fd 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 c670d3780e8..6b5c5a73e96 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 f957b57bb00..a0fc8275a84 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
>>>
>>
>> --
>> Richard Biener <rguenther@suse.de>
>> SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
>> Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)
> 
> 
> 


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-17  7:47         ` Richard Biener
@ 2021-09-17  8:06           ` Hongtao Liu
  0 siblings, 0 replies; 39+ messages in thread
From: Hongtao Liu @ 2021-09-17  8:06 UTC (permalink / raw)
  To: Richard Biener
  Cc: liuhongt, Jakub Jelinek, Florian Weimer, Segher Boessenkool,
	Richard Sandiford, Premachandra.Mallappa, GCC Patches,
	Bill Schmidt, Joseph Myers

On Fri, Sep 17, 2021 at 3:47 PM Richard Biener <rguenther@suse.de> wrote:
>
> On Fri, 17 Sep 2021, Hongtao Liu wrote:
>
> > On Thu, Sep 16, 2021 at 8:31 PM Richard Biener <rguenther@suse.de> wrote:
> > >
> > > On Thu, 16 Sep 2021, Hongtao Liu wrote:
> > >
> > > > On Thu, Sep 16, 2021 at 4:23 PM Richard Biener via Gcc-patches
> > > > <gcc-patches@gcc.gnu.org> wrote:
> > > > >
> > > > > On Thu, 16 Sep 2021, liuhongt wrote:
> > > > >
> > > > > > Ping
> > > > > > rebased on latest trunk.
> > > > > >
> > > > > > gcc/ChangeLog:
> > > > > >
> > > > > >       * common.opt (ftree-vectorize): Add Var(flag_tree_vectorize).
> > > > > >       * doc/invoke.texi (Options That Control Optimization): Update
> > > > > >       documents.
> > > > > >       * opts.c (default_options_table): Enable auto-vectorization at
> > > > > >       O2 with very-cheap cost model.
> > > > > >       (finish_options): Use cheap cost model for
> > > > > >       explicit -ftree{,-loop}-vectorize.
> > > > > >
> > > > > > gcc/testsuite/ChangeLog:
> > > > > >
> > > > > >       * c-c++-common/Wstringop-overflow-2.c: Adjust testcase.
> > > > > >       * g++.dg/tree-ssa/pr81408.C: Ditto.
> > > > > >       * g++.dg/warn/Wuninitialized-13.C: Ditto.
> > > > > >       * gcc.dg/Warray-bounds-51.c: Ditto.
> > > > > >       * gcc.dg/Warray-parameter-3.c: Ditto.
> > > > > >       * gcc.dg/Wstringop-overflow-13.c: Ditto.
> > > > > >       * gcc.dg/Wstringop-overflow-14.c: Ditto.
> > > > > >       * gcc.dg/Wstringop-overflow-21.c: Ditto.
> > > > > >       * gcc.dg/Wstringop-overflow-68.c: Ditto.
> > > > > >       * gcc.dg/gomp/pr46032-2.c: Ditto.
> > > > > >       * gcc.dg/gomp/pr46032-3.c: Ditto.
> > > > > >       * gcc.dg/gomp/simd-2.c: Ditto.
> > > > > >       * gcc.dg/gomp/simd-3.c: Ditto.
> > > > > >       * gcc.dg/graphite/fuse-1.c: Ditto.
> > > > > >       * gcc.dg/pr67089-6.c: Ditto.
> > > > > >       * gcc.dg/pr82929-2.c: Ditto.
> > > > > >       * gcc.dg/pr82929.c: Ditto.
> > > > > >       * gcc.dg/store_merging_1.c: Ditto.
> > > > > >       * gcc.dg/store_merging_11.c: Ditto.
> > > > > >       * gcc.dg/store_merging_15.c: Ditto.
> > > > > >       * gcc.dg/store_merging_16.c: Ditto.
> > > > > >       * gcc.dg/store_merging_19.c: Ditto.
> > > > > >       * gcc.dg/store_merging_24.c: Ditto.
> > > > > >       * gcc.dg/store_merging_25.c: Ditto.
> > > > > >       * gcc.dg/store_merging_28.c: Ditto.
> > > > > >       * gcc.dg/store_merging_30.c: Ditto.
> > > > > >       * gcc.dg/store_merging_5.c: Ditto.
> > > > > >       * gcc.dg/store_merging_7.c: Ditto.
> > > > > >       * gcc.dg/store_merging_8.c: Ditto.
> > > > > >       * gcc.dg/strlenopt-85.c: Ditto.
> > > > > >       * gcc.dg/tree-ssa/dump-6.c: Ditto.
> > > > > >       * gcc.dg/tree-ssa/pr19210-1.c: Ditto.
> > > > > >       * gcc.dg/tree-ssa/pr47059.c: Ditto.
> > > > > >       * gcc.dg/tree-ssa/pr86017.c: Ditto.
> > > > > >       * gcc.dg/tree-ssa/pr91482.c: Ditto.
> > > > > >       * gcc.dg/tree-ssa/predcom-1.c: Ditto.
> > > > > >       * gcc.dg/tree-ssa/predcom-dse-3.c: Ditto.
> > > > > >       * gcc.dg/tree-ssa/prefetch-3.c: Ditto.
> > > > > >       * gcc.dg/tree-ssa/prefetch-6.c: Ditto.
> > > > > >       * gcc.dg/tree-ssa/prefetch-8.c: Ditto.
> > > > > >       * gcc.dg/tree-ssa/prefetch-9.c: Ditto.
> > > > > >       * gcc.dg/tree-ssa/ssa-dse-18.c: Ditto.
> > > > > >       * gcc.dg/tree-ssa/ssa-dse-19.c: Ditto.
> > > > > >       * gcc.dg/uninit-40.c: Ditto.
> > > > > >       * gcc.dg/unroll-7.c: Ditto.
> > > > > >       * gcc.misc-tests/help.exp: Ditto.
> > > > > >       * gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
> > > > > >       * gcc.target/i386/pr22141.c: Ditto.
> > > > > >       * gcc.target/i386/pr34012.c: Ditto.
> > > > > >       * gcc.target/i386/pr49781-1.c: Ditto.
> > > > > >       * gcc.target/i386/pr95798-1.c: Ditto.
> > > > > >       * gcc.target/i386/pr95798-2.c: Ditto.
> > > > > >       * gfortran.dg/pr77498.f: Ditto.
> > > > > > ---
> > > > > >  gcc/common.opt                                 |  2 +-
> > > > > >  gcc/doc/invoke.texi                            |  8 +++++---
> > > > > >  gcc/opts.c                                     | 18 +++++++++++++++---
> > > > > >  .../c-c++-common/Wstringop-overflow-2.c        |  2 +-
> > > > > >  gcc/testsuite/g++.dg/tree-ssa/pr81408.C        |  2 +-
> > > > > >  gcc/testsuite/g++.dg/warn/Wuninitialized-13.C  |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/Warray-bounds-51.c        |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/Warray-parameter-3.c      |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/Wstringop-overflow-13.c   |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/Wstringop-overflow-14.c   |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/Wstringop-overflow-21.c   |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/Wstringop-overflow-68.c   |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/gomp/pr46032-2.c          |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/gomp/pr46032-3.c          |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/gomp/simd-2.c             |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/gomp/simd-3.c             |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/graphite/fuse-1.c         |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/pr67089-6.c               |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/pr82929-2.c               |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/pr82929.c                 |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/store_merging_1.c         |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/store_merging_11.c        |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/store_merging_15.c        |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/store_merging_16.c        |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/store_merging_19.c        |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/store_merging_24.c        |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/store_merging_25.c        |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/store_merging_28.c        |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/store_merging_30.c        |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/store_merging_5.c         |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/store_merging_7.c         |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/store_merging_8.c         |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/strlenopt-85.c            |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/tree-ssa/dump-6.c         |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c      |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/tree-ssa/pr47059.c        |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/tree-ssa/pr86017.c        |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/tree-ssa/pr91482.c        |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c      |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c  |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c     |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c     |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c     |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c     |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c     |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c     |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/uninit-40.c               |  2 +-
> > > > > >  gcc/testsuite/gcc.dg/unroll-7.c                |  2 +-
> > > > > >  gcc/testsuite/gcc.misc-tests/help.exp          |  2 +-
> > > > > >  .../i386/avx512vpopcntdqvl-vpopcntd-1.c        |  2 +-
> > > > > >  gcc/testsuite/gcc.target/i386/pr22141.c        |  2 +-
> > > > > >  gcc/testsuite/gcc.target/i386/pr34012.c        |  2 +-
> > > > > >  gcc/testsuite/gcc.target/i386/pr49781-1.c      |  2 +-
> > > > > >  gcc/testsuite/gcc.target/i386/pr95798-1.c      |  2 +-
> > > > > >  gcc/testsuite/gcc.target/i386/pr95798-2.c      |  2 +-
> > > > > >  gcc/testsuite/gfortran.dg/pr77498.f            |  2 +-
> > > > > >  56 files changed, 74 insertions(+), 60 deletions(-)
> > > > > >
> > > > > > diff --git a/gcc/common.opt b/gcc/common.opt
> > > > > > index b921f5e3b25..4f2c0294c29 100644
> > > > > > --- a/gcc/common.opt
> > > > > > +++ b/gcc/common.opt
> > > > > > @@ -3031,7 +3031,7 @@ Perform variable tracking and also tag variables that are uninitialized.
> > > > > >
> > > > > >  ; 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/doc/invoke.texi b/gcc/doc/invoke.texi
> > > > > > index 78cfc100ac2..be022ef8024 100644
> > > > > > --- a/gcc/doc/invoke.texi
> > > > > > +++ b/gcc/doc/invoke.texi
> > > > > > @@ -10409,9 +10409,13 @@ also turns on the following optimization flags:
> > > > > >  -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 @gol
> > > > >
> > > > > the above is redundant
> > > > >
> > > > > > +-fvect-cost-model=very-cheap}
> > > > > >
> > > > > >  Please note the warning under @option{-fgcse} about
> > > > > >  invoking @option{-O2} on programs that use computed gotos.
> > > > > > @@ -10431,9 +10435,7 @@ by @option{-O2} and also turns on the following optimization flags:
> > > > > >  -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
> > > > >
> > > > > likewise - so just remove it here as you are around
> > > > >
> > > > > >  -fvect-cost-model=dynamic @gol
> > > > > > diff --git a/gcc/opts.c b/gcc/opts.c
> > > > > > index 1d2d22d7a3f..cee372a3235 100644
> > > > > > --- a/gcc/opts.c
> > > > > > +++ b/gcc/opts.c
> > > > > > @@ -634,7 +634,8 @@ static const struct default_options default_options_table[] =
> > > > > >      { 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,9 @@ static const struct default_options default_options_table[] =
> > > > > >      { 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 +667,7 @@ static const struct default_options default_options_table[] =
> > > > > >      { 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 },
> > > > > > @@ -1331,6 +1333,16 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
> > > > > >        = (opts->x_flag_unroll_loops
> > > > > >           || opts->x_flag_peel_loops
> > > > > >           || opts->x_optimize >= 3);
> > > > > > +
> > > > > > +  /* 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);
> > > > > > +
> > > > > > +
> > > > >
> > > > > please avoid adding excessive vertical space at the end of the function
> > > > >
> > > > > >  }
> > > > > >
> > > > > >  #define LEFT_COLUMN  27
> > > > > > diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > > > > index 1d79930cd58..9351f7e7a1a 100644
> > > > > > --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > > > > +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > > > > @@ -1,7 +1,7 @@
> > > > > >  /* PR middle-end/91458 - inconsistent warning for writing past the end
> > > > > >     of an array member
> > > > > >     { dg-do compile }
> > > > > > -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
> > > > > > +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
> > > > >
> > > > > The testcase is large - what part requires this change?  Given the
> > > > > testcase was added for inconsistent warnings do they now become
> > > > > inconsistent again as we enable vectorization at -O2?
> > > > >
> > > > > That said, the testcase adjustments need some explaining - I suppose
> > > > > you didn't just slap -fno-tree-vectorize to all of those changing
> > > > > behavior?
> > > > >
> > > > void ga1_ (void)
> > > > {
> > > >   a1_.a[0] = 0;
> > > >   a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
> > > >   a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
> > > >
> > > >   struct A1 a;
> > > >   a.a[0] = 0;
> > > >   a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
> > > >   a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
> > > >   sink (&a);
> > > > }
> > > >
> > > > It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
> > > > there are 2 accesses, but after enabling vectorization, there's only
> > > > one access, so one warning is missing which causes the failure.
> > > >
> > > >    <bb 2> [local count: 1073741824]:
> > > >   a1__.a[0] = 0;
> > > >   a1__.a[1] = 1;
> > > >   a1__.a[2] = 2;
> > > >   MEM <char[1]> [(struct A1 *)&a + 1B] = {};
> > > >   a.n = 1;
> > > >   MEM <vector(2) char> [(char *)&a + 2B] = { 1, 2 };
> > > >   sink (&a);
> > > >   a ={v} {CLOBBER};
> > > >   return;
> > >
> > > I see, so it seems you looked into each instance you changed - I don't
> > > want to repeat that exercise here.
> > >
> > Going through all testcases i changed, i found 3 miss optimization
> > issue after enable O2 vectorization. The issues are recorded in
> > pr102382/pr102382/pr102384, I'm not sure if they're block issues which
> > needed to be solved first before installing the patch.
>
> All those issues also appear when using -O3, correct?  I had a look
Yes.
> and the strlenopt bug should be fixable, but not sure about the
> others.
>
> > Also I notice  openmp case gcc.dg/gomp/simd-3.c #pragma omp for simd
> > will enable vectorization for the region w/ original cost model cheap,
> > but now cost model is very cheap, would that be ok?
>
> I think omp for simd will set force_vectorize on the loop, we might
> want to consider what that should mean for the purpose of selecting
> a cost model.  There's also the 'vectorize' pragma with a similar
> effect.  One might argue both cases warrant turning off the cost
> model ...?
>
> Richard.
>
> > > Thus the patch is OK with the minor nits I had fixed.  Note that
> > > other targets testsuites likely will need similar adjustments so
> > > please watch out (but a lot of target people are in CC and could
> > > deal with such fallout themselves).
> > >
> > > Please also prepare an entry for gcc-12/changes.html since this
> > > is an important change.  Make sure to mention -fvect-cost-model
> > > since otherwise people might expect vectorization to be as good
> > > as with -O3.
> > >
> > > Thanks,
> > > Richard.
> > >
> > > >
> > > > > Thanks,
> > > > > Richard.
> > > > >
> > > > > >  void sink (void*);
> > > > > >
> > > > > > diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
> > > > > > index 39e32fd4bc9..bc14309480c 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 49ee878806a..60e8dd4f0e2 100644
> > > > > > --- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> > > > > > +++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> > > > > > @@ -1,6 +1,6 @@
> > > > > >  /* PR c/98597 - ICE in -Wuninitialized printing a MEM_REF
> > > > > >     { dg-do compile }
> > > > > > -   { dg-options "-O2 -Wall" } */
> > > > > > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> > > > > >
> > > > > >  struct shared_count {
> > > > > >    shared_count () { }
> > > > > > diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-51.c b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > > > > > index 6028b11637c..8b81a0ccfa7 100644
> > > > > > --- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > > > > > +++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > > > > > @@ -1,7 +1,7 @@
> > > > > >  /* PR middle-end/92333 - missing variable name referencing VLA in warnings
> > > > > >     PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
> > > > > >     { dg-do compile }
> > > > > > -   { dg-options "-O2 -Wall" } */
> > > > > > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> > > > > >
> > > > > >  void sink (void*);
> > > > > >
> > > > > > diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-3.c b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > > > > > index cbf3e9339f5..fbef715aa99 100644
> > > > > > --- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > > > > > +++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > > > > > @@ -59,7 +59,7 @@ void fas1 (int[static 2]);    // { dg-warning "\\\[-Warray-parameter=" }
> > > > > >
> > > > > >  /* Also verify that -Warray-bounds doesn't trigger for ordinary array
> > > > > >     parameters...  */
> > > > > > -#pragma GCC optimize "2"
> > > > > > +#pragma GCC optimize ("2,-fno-tree-vectorize")
> > > > > >
> > > > > >  __attribute__ ((noipa)) void
> > > > > >  gca3 (char a[3])
> > > > > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > > > > > index bd513151cea..a78242bf26e 100644
> > > > > > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > > > > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > > > > > @@ -3,7 +3,7 @@
> > > > > >     PR middle-end/89911 - ICE on a call with no arguments to strnlen
> > > > > >     declared with no prototype
> > > > > >     { dg-do compile }
> > > > > > -   { dg-options "-O2 -Wall" } */
> > > > > > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> > > > > >
> > > > > >  typedef __SIZE_TYPE__ size_t;
> > > > > >
> > > > > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > > > > > index d6201b068b6..808bf87c386 100644
> > > > > > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > > > > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > > > > > @@ -2,7 +2,7 @@
> > > > > >     types than char are diagnosed.
> > > > > >     { dg-do compile }
> > > > > >     { dg-require-effective-target int32plus }
> > > > > > -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> > > > > > +   { dg-options "-O2 -fno-tree-vectorize -Wall -Wno-array-bounds" } */
> > > > > >
> > > > > >  typedef __INT16_TYPE__  int16_t;
> > > > > >  typedef __INT32_TYPE__  int32_t;
> > > > > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > > > > > index 3a27460220c..f418a17ca93 100644
> > > > > > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > > > > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > > > > > @@ -1,7 +1,7 @@
> > > > > >  /* PR middle-end/92312 - bogus -Wstringop-overflow storing into a trailing
> > > > > >     array backed by larger buffer
> > > > > >     { dg-do compile }
> > > > > > -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> > > > > > +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-tree-vectorize" } */
> > > > > >
> > > > > >  struct S0 { char a, b[0]; };
> > > > > >
> > > > > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > > > > > index 6bcba274541..7cc1012130c 100644
> > > > > > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > > > > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > > > > > @@ -2,7 +2,7 @@
> > > > > >     a larger scalar into a smaller array
> > > > > >     Verify overflow by aggregate stores.
> > > > > >     { dg-do compile }
> > > > > > -   { dg-options "-O2" } */
> > > > > > +   { dg-options "-O2 -fno-tree-vectorize" } */
> > > > > >
> > > > > >  #define A(N) (A ## N)
> > > > > >  #define Ac1 (AC1){ 0 }
> > > > > > diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
> > > > > > index e110880bd8e..2e562618489 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 a4af7ec4a8a..da1ab487385 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 85acb980f10..f4912127b81 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 86fee858673..c75060c07ae 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 527b6e5c415..61289d312c2 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 db2ffdfeca4..b59d75b2318 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 3442f91af02..b886f1cce76 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 bb84f2b21a3..123e1919cec 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 4cc43dfd9e1..91ca925be0e 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 2ec2394afb9..60ed5cd8bf9 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_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
> > > > > > index acd7de571f8..13fcca4aa11 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 9545dcce3de..cd83f1c0fe5 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 0841bb4deee..0a2bbc4bfde 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 744fe60e8e0..5291bb9e986 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 cf182190e91..96611b5e57b 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 2d6cffc4694..fadb7fff993 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 694d560a621..baf94efe733 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 6e7c72510ff..b0cb0da78e0 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 c744ece6407..dbe000a463e 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 e710a544ff0..d719e0a2257 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 e049e0c30e0..2ba1ee05700 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 70659c00c0e..6c803908781 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 50d86a00485..b9e40e964c1 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 9f9c61aa213..860cde12c0f 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 f216e83c7b3..c7ef73ad59e 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 7d6a724e4ad..0ddad573129 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 f68be2b3379..8c3d9a4fc58 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 ec08d6c0318..1fc8f089345 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 467903bf3fc..46f0d0c2317 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 12f09016943..3fa71685ace 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 cbd6a80d345..00f41c3e4f4 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 da4847320b1..e8848c30acc 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 92b2df80ec8..2e7b5b496ea 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 718b7466e50..7bb8d060631 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 c015191ca32..8708079d397 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 055369bf8b1..695af5757cc 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 5e034d26947..eb6d8686c6a 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=target,optimizers" "" "" ""
> > > > > >  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 709cd21e671..a732bc466db 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/pr22141.c b/gcc/testsuite/gcc.target/i386/pr22141.c
> > > > > > index 036422e8ccf..b68b97f3f72 100644
> > > > > > --- a/gcc/testsuite/gcc.target/i386/pr22141.c
> > > > > > +++ b/gcc/testsuite/gcc.target/i386/pr22141.c
> > > > > > @@ -1,6 +1,6 @@
> > > > > >  /* PR middle-end/22141 */
> > > > > >  /* { dg-do compile } */
> > > > > > -/* { dg-options "-Os" } */
> > > > > > +/* { dg-options "-Os -fno-tree-vectorize" } */
> > > > > >
> > > > > >  extern void abort (void);
> > > > > >
> > > > > > diff --git a/gcc/testsuite/gcc.target/i386/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
> > > > > > index d0cffa05290..1c1f0eea52e 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 60f9d50d866..d5a2e32db97 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 9a7e32d6f2f..526f48921fd 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 c670d3780e8..6b5c5a73e96 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 f957b57bb00..a0fc8275a84 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
> > > > > >
> > > > >
> > > > > --
> > > > > Richard Biener <rguenther@suse.de>
> > > > > SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
> > > > > Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)
> > > >
> > > >
> > > >
> > > >
> > >
> > > --
> > > Richard Biener <rguenther@suse.de>
> > > SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
> > > Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)
> >
> >
> >
> >
>
> --
> Richard Biener <rguenther@suse.de>
> SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
> Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)



-- 
BR,
Hongtao

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-17  3:26       ` Hongtao Liu
@ 2021-09-17  7:47         ` Richard Biener
  2021-09-17  8:06           ` Hongtao Liu
  0 siblings, 1 reply; 39+ messages in thread
From: Richard Biener @ 2021-09-17  7:47 UTC (permalink / raw)
  To: Hongtao Liu
  Cc: liuhongt, Jakub Jelinek, Florian Weimer, Segher Boessenkool,
	Richard Sandiford, Premachandra.Mallappa, GCC Patches,
	Bill Schmidt, Joseph Myers

On Fri, 17 Sep 2021, Hongtao Liu wrote:

> On Thu, Sep 16, 2021 at 8:31 PM Richard Biener <rguenther@suse.de> wrote:
> >
> > On Thu, 16 Sep 2021, Hongtao Liu wrote:
> >
> > > On Thu, Sep 16, 2021 at 4:23 PM Richard Biener via Gcc-patches
> > > <gcc-patches@gcc.gnu.org> wrote:
> > > >
> > > > On Thu, 16 Sep 2021, liuhongt wrote:
> > > >
> > > > > Ping
> > > > > rebased on latest trunk.
> > > > >
> > > > > gcc/ChangeLog:
> > > > >
> > > > >       * common.opt (ftree-vectorize): Add Var(flag_tree_vectorize).
> > > > >       * doc/invoke.texi (Options That Control Optimization): Update
> > > > >       documents.
> > > > >       * opts.c (default_options_table): Enable auto-vectorization at
> > > > >       O2 with very-cheap cost model.
> > > > >       (finish_options): Use cheap cost model for
> > > > >       explicit -ftree{,-loop}-vectorize.
> > > > >
> > > > > gcc/testsuite/ChangeLog:
> > > > >
> > > > >       * c-c++-common/Wstringop-overflow-2.c: Adjust testcase.
> > > > >       * g++.dg/tree-ssa/pr81408.C: Ditto.
> > > > >       * g++.dg/warn/Wuninitialized-13.C: Ditto.
> > > > >       * gcc.dg/Warray-bounds-51.c: Ditto.
> > > > >       * gcc.dg/Warray-parameter-3.c: Ditto.
> > > > >       * gcc.dg/Wstringop-overflow-13.c: Ditto.
> > > > >       * gcc.dg/Wstringop-overflow-14.c: Ditto.
> > > > >       * gcc.dg/Wstringop-overflow-21.c: Ditto.
> > > > >       * gcc.dg/Wstringop-overflow-68.c: Ditto.
> > > > >       * gcc.dg/gomp/pr46032-2.c: Ditto.
> > > > >       * gcc.dg/gomp/pr46032-3.c: Ditto.
> > > > >       * gcc.dg/gomp/simd-2.c: Ditto.
> > > > >       * gcc.dg/gomp/simd-3.c: Ditto.
> > > > >       * gcc.dg/graphite/fuse-1.c: Ditto.
> > > > >       * gcc.dg/pr67089-6.c: Ditto.
> > > > >       * gcc.dg/pr82929-2.c: Ditto.
> > > > >       * gcc.dg/pr82929.c: Ditto.
> > > > >       * gcc.dg/store_merging_1.c: Ditto.
> > > > >       * gcc.dg/store_merging_11.c: Ditto.
> > > > >       * gcc.dg/store_merging_15.c: Ditto.
> > > > >       * gcc.dg/store_merging_16.c: Ditto.
> > > > >       * gcc.dg/store_merging_19.c: Ditto.
> > > > >       * gcc.dg/store_merging_24.c: Ditto.
> > > > >       * gcc.dg/store_merging_25.c: Ditto.
> > > > >       * gcc.dg/store_merging_28.c: Ditto.
> > > > >       * gcc.dg/store_merging_30.c: Ditto.
> > > > >       * gcc.dg/store_merging_5.c: Ditto.
> > > > >       * gcc.dg/store_merging_7.c: Ditto.
> > > > >       * gcc.dg/store_merging_8.c: Ditto.
> > > > >       * gcc.dg/strlenopt-85.c: Ditto.
> > > > >       * gcc.dg/tree-ssa/dump-6.c: Ditto.
> > > > >       * gcc.dg/tree-ssa/pr19210-1.c: Ditto.
> > > > >       * gcc.dg/tree-ssa/pr47059.c: Ditto.
> > > > >       * gcc.dg/tree-ssa/pr86017.c: Ditto.
> > > > >       * gcc.dg/tree-ssa/pr91482.c: Ditto.
> > > > >       * gcc.dg/tree-ssa/predcom-1.c: Ditto.
> > > > >       * gcc.dg/tree-ssa/predcom-dse-3.c: Ditto.
> > > > >       * gcc.dg/tree-ssa/prefetch-3.c: Ditto.
> > > > >       * gcc.dg/tree-ssa/prefetch-6.c: Ditto.
> > > > >       * gcc.dg/tree-ssa/prefetch-8.c: Ditto.
> > > > >       * gcc.dg/tree-ssa/prefetch-9.c: Ditto.
> > > > >       * gcc.dg/tree-ssa/ssa-dse-18.c: Ditto.
> > > > >       * gcc.dg/tree-ssa/ssa-dse-19.c: Ditto.
> > > > >       * gcc.dg/uninit-40.c: Ditto.
> > > > >       * gcc.dg/unroll-7.c: Ditto.
> > > > >       * gcc.misc-tests/help.exp: Ditto.
> > > > >       * gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
> > > > >       * gcc.target/i386/pr22141.c: Ditto.
> > > > >       * gcc.target/i386/pr34012.c: Ditto.
> > > > >       * gcc.target/i386/pr49781-1.c: Ditto.
> > > > >       * gcc.target/i386/pr95798-1.c: Ditto.
> > > > >       * gcc.target/i386/pr95798-2.c: Ditto.
> > > > >       * gfortran.dg/pr77498.f: Ditto.
> > > > > ---
> > > > >  gcc/common.opt                                 |  2 +-
> > > > >  gcc/doc/invoke.texi                            |  8 +++++---
> > > > >  gcc/opts.c                                     | 18 +++++++++++++++---
> > > > >  .../c-c++-common/Wstringop-overflow-2.c        |  2 +-
> > > > >  gcc/testsuite/g++.dg/tree-ssa/pr81408.C        |  2 +-
> > > > >  gcc/testsuite/g++.dg/warn/Wuninitialized-13.C  |  2 +-
> > > > >  gcc/testsuite/gcc.dg/Warray-bounds-51.c        |  2 +-
> > > > >  gcc/testsuite/gcc.dg/Warray-parameter-3.c      |  2 +-
> > > > >  gcc/testsuite/gcc.dg/Wstringop-overflow-13.c   |  2 +-
> > > > >  gcc/testsuite/gcc.dg/Wstringop-overflow-14.c   |  2 +-
> > > > >  gcc/testsuite/gcc.dg/Wstringop-overflow-21.c   |  2 +-
> > > > >  gcc/testsuite/gcc.dg/Wstringop-overflow-68.c   |  2 +-
> > > > >  gcc/testsuite/gcc.dg/gomp/pr46032-2.c          |  2 +-
> > > > >  gcc/testsuite/gcc.dg/gomp/pr46032-3.c          |  2 +-
> > > > >  gcc/testsuite/gcc.dg/gomp/simd-2.c             |  2 +-
> > > > >  gcc/testsuite/gcc.dg/gomp/simd-3.c             |  2 +-
> > > > >  gcc/testsuite/gcc.dg/graphite/fuse-1.c         |  2 +-
> > > > >  gcc/testsuite/gcc.dg/pr67089-6.c               |  2 +-
> > > > >  gcc/testsuite/gcc.dg/pr82929-2.c               |  2 +-
> > > > >  gcc/testsuite/gcc.dg/pr82929.c                 |  2 +-
> > > > >  gcc/testsuite/gcc.dg/store_merging_1.c         |  2 +-
> > > > >  gcc/testsuite/gcc.dg/store_merging_11.c        |  2 +-
> > > > >  gcc/testsuite/gcc.dg/store_merging_15.c        |  2 +-
> > > > >  gcc/testsuite/gcc.dg/store_merging_16.c        |  2 +-
> > > > >  gcc/testsuite/gcc.dg/store_merging_19.c        |  2 +-
> > > > >  gcc/testsuite/gcc.dg/store_merging_24.c        |  2 +-
> > > > >  gcc/testsuite/gcc.dg/store_merging_25.c        |  2 +-
> > > > >  gcc/testsuite/gcc.dg/store_merging_28.c        |  2 +-
> > > > >  gcc/testsuite/gcc.dg/store_merging_30.c        |  2 +-
> > > > >  gcc/testsuite/gcc.dg/store_merging_5.c         |  2 +-
> > > > >  gcc/testsuite/gcc.dg/store_merging_7.c         |  2 +-
> > > > >  gcc/testsuite/gcc.dg/store_merging_8.c         |  2 +-
> > > > >  gcc/testsuite/gcc.dg/strlenopt-85.c            |  2 +-
> > > > >  gcc/testsuite/gcc.dg/tree-ssa/dump-6.c         |  2 +-
> > > > >  gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c      |  2 +-
> > > > >  gcc/testsuite/gcc.dg/tree-ssa/pr47059.c        |  2 +-
> > > > >  gcc/testsuite/gcc.dg/tree-ssa/pr86017.c        |  2 +-
> > > > >  gcc/testsuite/gcc.dg/tree-ssa/pr91482.c        |  2 +-
> > > > >  gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c      |  2 +-
> > > > >  gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c  |  2 +-
> > > > >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c     |  2 +-
> > > > >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c     |  2 +-
> > > > >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c     |  2 +-
> > > > >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c     |  2 +-
> > > > >  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c     |  2 +-
> > > > >  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c     |  2 +-
> > > > >  gcc/testsuite/gcc.dg/uninit-40.c               |  2 +-
> > > > >  gcc/testsuite/gcc.dg/unroll-7.c                |  2 +-
> > > > >  gcc/testsuite/gcc.misc-tests/help.exp          |  2 +-
> > > > >  .../i386/avx512vpopcntdqvl-vpopcntd-1.c        |  2 +-
> > > > >  gcc/testsuite/gcc.target/i386/pr22141.c        |  2 +-
> > > > >  gcc/testsuite/gcc.target/i386/pr34012.c        |  2 +-
> > > > >  gcc/testsuite/gcc.target/i386/pr49781-1.c      |  2 +-
> > > > >  gcc/testsuite/gcc.target/i386/pr95798-1.c      |  2 +-
> > > > >  gcc/testsuite/gcc.target/i386/pr95798-2.c      |  2 +-
> > > > >  gcc/testsuite/gfortran.dg/pr77498.f            |  2 +-
> > > > >  56 files changed, 74 insertions(+), 60 deletions(-)
> > > > >
> > > > > diff --git a/gcc/common.opt b/gcc/common.opt
> > > > > index b921f5e3b25..4f2c0294c29 100644
> > > > > --- a/gcc/common.opt
> > > > > +++ b/gcc/common.opt
> > > > > @@ -3031,7 +3031,7 @@ Perform variable tracking and also tag variables that are uninitialized.
> > > > >
> > > > >  ; 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/doc/invoke.texi b/gcc/doc/invoke.texi
> > > > > index 78cfc100ac2..be022ef8024 100644
> > > > > --- a/gcc/doc/invoke.texi
> > > > > +++ b/gcc/doc/invoke.texi
> > > > > @@ -10409,9 +10409,13 @@ also turns on the following optimization flags:
> > > > >  -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 @gol
> > > >
> > > > the above is redundant
> > > >
> > > > > +-fvect-cost-model=very-cheap}
> > > > >
> > > > >  Please note the warning under @option{-fgcse} about
> > > > >  invoking @option{-O2} on programs that use computed gotos.
> > > > > @@ -10431,9 +10435,7 @@ by @option{-O2} and also turns on the following optimization flags:
> > > > >  -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
> > > >
> > > > likewise - so just remove it here as you are around
> > > >
> > > > >  -fvect-cost-model=dynamic @gol
> > > > > diff --git a/gcc/opts.c b/gcc/opts.c
> > > > > index 1d2d22d7a3f..cee372a3235 100644
> > > > > --- a/gcc/opts.c
> > > > > +++ b/gcc/opts.c
> > > > > @@ -634,7 +634,8 @@ static const struct default_options default_options_table[] =
> > > > >      { 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,9 @@ static const struct default_options default_options_table[] =
> > > > >      { 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 +667,7 @@ static const struct default_options default_options_table[] =
> > > > >      { 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 },
> > > > > @@ -1331,6 +1333,16 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
> > > > >        = (opts->x_flag_unroll_loops
> > > > >           || opts->x_flag_peel_loops
> > > > >           || opts->x_optimize >= 3);
> > > > > +
> > > > > +  /* 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);
> > > > > +
> > > > > +
> > > >
> > > > please avoid adding excessive vertical space at the end of the function
> > > >
> > > > >  }
> > > > >
> > > > >  #define LEFT_COLUMN  27
> > > > > diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > > > index 1d79930cd58..9351f7e7a1a 100644
> > > > > --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > > > +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > > > @@ -1,7 +1,7 @@
> > > > >  /* PR middle-end/91458 - inconsistent warning for writing past the end
> > > > >     of an array member
> > > > >     { dg-do compile }
> > > > > -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
> > > > > +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
> > > >
> > > > The testcase is large - what part requires this change?  Given the
> > > > testcase was added for inconsistent warnings do they now become
> > > > inconsistent again as we enable vectorization at -O2?
> > > >
> > > > That said, the testcase adjustments need some explaining - I suppose
> > > > you didn't just slap -fno-tree-vectorize to all of those changing
> > > > behavior?
> > > >
> > > void ga1_ (void)
> > > {
> > >   a1_.a[0] = 0;
> > >   a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
> > >   a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
> > >
> > >   struct A1 a;
> > >   a.a[0] = 0;
> > >   a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
> > >   a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
> > >   sink (&a);
> > > }
> > >
> > > It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
> > > there are 2 accesses, but after enabling vectorization, there's only
> > > one access, so one warning is missing which causes the failure.
> > >
> > >    <bb 2> [local count: 1073741824]:
> > >   a1__.a[0] = 0;
> > >   a1__.a[1] = 1;
> > >   a1__.a[2] = 2;
> > >   MEM <char[1]> [(struct A1 *)&a + 1B] = {};
> > >   a.n = 1;
> > >   MEM <vector(2) char> [(char *)&a + 2B] = { 1, 2 };
> > >   sink (&a);
> > >   a ={v} {CLOBBER};
> > >   return;
> >
> > I see, so it seems you looked into each instance you changed - I don't
> > want to repeat that exercise here.
> >
> Going through all testcases i changed, i found 3 miss optimization
> issue after enable O2 vectorization. The issues are recorded in
> pr102382/pr102382/pr102384, I'm not sure if they're block issues which
> needed to be solved first before installing the patch.

All those issues also appear when using -O3, correct?  I had a look
and the strlenopt bug should be fixable, but not sure about the
others.

> Also I notice  openmp case gcc.dg/gomp/simd-3.c #pragma omp for simd
> will enable vectorization for the region w/ original cost model cheap,
> but now cost model is very cheap, would that be ok?

I think omp for simd will set force_vectorize on the loop, we might
want to consider what that should mean for the purpose of selecting
a cost model.  There's also the 'vectorize' pragma with a similar
effect.  One might argue both cases warrant turning off the cost
model ...?

Richard.

> > Thus the patch is OK with the minor nits I had fixed.  Note that
> > other targets testsuites likely will need similar adjustments so
> > please watch out (but a lot of target people are in CC and could
> > deal with such fallout themselves).
> >
> > Please also prepare an entry for gcc-12/changes.html since this
> > is an important change.  Make sure to mention -fvect-cost-model
> > since otherwise people might expect vectorization to be as good
> > as with -O3.
> >
> > Thanks,
> > Richard.
> >
> > >
> > > > Thanks,
> > > > Richard.
> > > >
> > > > >  void sink (void*);
> > > > >
> > > > > diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
> > > > > index 39e32fd4bc9..bc14309480c 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 49ee878806a..60e8dd4f0e2 100644
> > > > > --- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> > > > > +++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> > > > > @@ -1,6 +1,6 @@
> > > > >  /* PR c/98597 - ICE in -Wuninitialized printing a MEM_REF
> > > > >     { dg-do compile }
> > > > > -   { dg-options "-O2 -Wall" } */
> > > > > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> > > > >
> > > > >  struct shared_count {
> > > > >    shared_count () { }
> > > > > diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-51.c b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > > > > index 6028b11637c..8b81a0ccfa7 100644
> > > > > --- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > > > > +++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > > > > @@ -1,7 +1,7 @@
> > > > >  /* PR middle-end/92333 - missing variable name referencing VLA in warnings
> > > > >     PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
> > > > >     { dg-do compile }
> > > > > -   { dg-options "-O2 -Wall" } */
> > > > > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> > > > >
> > > > >  void sink (void*);
> > > > >
> > > > > diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-3.c b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > > > > index cbf3e9339f5..fbef715aa99 100644
> > > > > --- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > > > > +++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > > > > @@ -59,7 +59,7 @@ void fas1 (int[static 2]);    // { dg-warning "\\\[-Warray-parameter=" }
> > > > >
> > > > >  /* Also verify that -Warray-bounds doesn't trigger for ordinary array
> > > > >     parameters...  */
> > > > > -#pragma GCC optimize "2"
> > > > > +#pragma GCC optimize ("2,-fno-tree-vectorize")
> > > > >
> > > > >  __attribute__ ((noipa)) void
> > > > >  gca3 (char a[3])
> > > > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > > > > index bd513151cea..a78242bf26e 100644
> > > > > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > > > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > > > > @@ -3,7 +3,7 @@
> > > > >     PR middle-end/89911 - ICE on a call with no arguments to strnlen
> > > > >     declared with no prototype
> > > > >     { dg-do compile }
> > > > > -   { dg-options "-O2 -Wall" } */
> > > > > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> > > > >
> > > > >  typedef __SIZE_TYPE__ size_t;
> > > > >
> > > > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > > > > index d6201b068b6..808bf87c386 100644
> > > > > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > > > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > > > > @@ -2,7 +2,7 @@
> > > > >     types than char are diagnosed.
> > > > >     { dg-do compile }
> > > > >     { dg-require-effective-target int32plus }
> > > > > -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> > > > > +   { dg-options "-O2 -fno-tree-vectorize -Wall -Wno-array-bounds" } */
> > > > >
> > > > >  typedef __INT16_TYPE__  int16_t;
> > > > >  typedef __INT32_TYPE__  int32_t;
> > > > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > > > > index 3a27460220c..f418a17ca93 100644
> > > > > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > > > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > > > > @@ -1,7 +1,7 @@
> > > > >  /* PR middle-end/92312 - bogus -Wstringop-overflow storing into a trailing
> > > > >     array backed by larger buffer
> > > > >     { dg-do compile }
> > > > > -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> > > > > +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-tree-vectorize" } */
> > > > >
> > > > >  struct S0 { char a, b[0]; };
> > > > >
> > > > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > > > > index 6bcba274541..7cc1012130c 100644
> > > > > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > > > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > > > > @@ -2,7 +2,7 @@
> > > > >     a larger scalar into a smaller array
> > > > >     Verify overflow by aggregate stores.
> > > > >     { dg-do compile }
> > > > > -   { dg-options "-O2" } */
> > > > > +   { dg-options "-O2 -fno-tree-vectorize" } */
> > > > >
> > > > >  #define A(N) (A ## N)
> > > > >  #define Ac1 (AC1){ 0 }
> > > > > diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
> > > > > index e110880bd8e..2e562618489 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 a4af7ec4a8a..da1ab487385 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 85acb980f10..f4912127b81 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 86fee858673..c75060c07ae 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 527b6e5c415..61289d312c2 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 db2ffdfeca4..b59d75b2318 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 3442f91af02..b886f1cce76 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 bb84f2b21a3..123e1919cec 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 4cc43dfd9e1..91ca925be0e 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 2ec2394afb9..60ed5cd8bf9 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_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
> > > > > index acd7de571f8..13fcca4aa11 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 9545dcce3de..cd83f1c0fe5 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 0841bb4deee..0a2bbc4bfde 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 744fe60e8e0..5291bb9e986 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 cf182190e91..96611b5e57b 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 2d6cffc4694..fadb7fff993 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 694d560a621..baf94efe733 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 6e7c72510ff..b0cb0da78e0 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 c744ece6407..dbe000a463e 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 e710a544ff0..d719e0a2257 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 e049e0c30e0..2ba1ee05700 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 70659c00c0e..6c803908781 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 50d86a00485..b9e40e964c1 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 9f9c61aa213..860cde12c0f 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 f216e83c7b3..c7ef73ad59e 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 7d6a724e4ad..0ddad573129 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 f68be2b3379..8c3d9a4fc58 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 ec08d6c0318..1fc8f089345 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 467903bf3fc..46f0d0c2317 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 12f09016943..3fa71685ace 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 cbd6a80d345..00f41c3e4f4 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 da4847320b1..e8848c30acc 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 92b2df80ec8..2e7b5b496ea 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 718b7466e50..7bb8d060631 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 c015191ca32..8708079d397 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 055369bf8b1..695af5757cc 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 5e034d26947..eb6d8686c6a 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=target,optimizers" "" "" ""
> > > > >  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 709cd21e671..a732bc466db 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/pr22141.c b/gcc/testsuite/gcc.target/i386/pr22141.c
> > > > > index 036422e8ccf..b68b97f3f72 100644
> > > > > --- a/gcc/testsuite/gcc.target/i386/pr22141.c
> > > > > +++ b/gcc/testsuite/gcc.target/i386/pr22141.c
> > > > > @@ -1,6 +1,6 @@
> > > > >  /* PR middle-end/22141 */
> > > > >  /* { dg-do compile } */
> > > > > -/* { dg-options "-Os" } */
> > > > > +/* { dg-options "-Os -fno-tree-vectorize" } */
> > > > >
> > > > >  extern void abort (void);
> > > > >
> > > > > diff --git a/gcc/testsuite/gcc.target/i386/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
> > > > > index d0cffa05290..1c1f0eea52e 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 60f9d50d866..d5a2e32db97 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 9a7e32d6f2f..526f48921fd 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 c670d3780e8..6b5c5a73e96 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 f957b57bb00..a0fc8275a84 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
> > > > >
> > > >
> > > > --
> > > > Richard Biener <rguenther@suse.de>
> > > > SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
> > > > Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)
> > >
> > >
> > >
> > >
> >
> > --
> > Richard Biener <rguenther@suse.de>
> > SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
> > Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)
> 
> 
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-16 12:31     ` Richard Biener
@ 2021-09-17  3:26       ` Hongtao Liu
  2021-09-17  7:47         ` Richard Biener
  0 siblings, 1 reply; 39+ messages in thread
From: Hongtao Liu @ 2021-09-17  3:26 UTC (permalink / raw)
  To: Richard Biener
  Cc: liuhongt, Jakub Jelinek, Florian Weimer, Segher Boessenkool,
	Richard Sandiford, Premachandra.Mallappa, GCC Patches,
	Bill Schmidt, Joseph Myers

On Thu, Sep 16, 2021 at 8:31 PM Richard Biener <rguenther@suse.de> wrote:
>
> On Thu, 16 Sep 2021, Hongtao Liu wrote:
>
> > On Thu, Sep 16, 2021 at 4:23 PM Richard Biener via Gcc-patches
> > <gcc-patches@gcc.gnu.org> wrote:
> > >
> > > On Thu, 16 Sep 2021, liuhongt wrote:
> > >
> > > > Ping
> > > > rebased on latest trunk.
> > > >
> > > > gcc/ChangeLog:
> > > >
> > > >       * common.opt (ftree-vectorize): Add Var(flag_tree_vectorize).
> > > >       * doc/invoke.texi (Options That Control Optimization): Update
> > > >       documents.
> > > >       * opts.c (default_options_table): Enable auto-vectorization at
> > > >       O2 with very-cheap cost model.
> > > >       (finish_options): Use cheap cost model for
> > > >       explicit -ftree{,-loop}-vectorize.
> > > >
> > > > gcc/testsuite/ChangeLog:
> > > >
> > > >       * c-c++-common/Wstringop-overflow-2.c: Adjust testcase.
> > > >       * g++.dg/tree-ssa/pr81408.C: Ditto.
> > > >       * g++.dg/warn/Wuninitialized-13.C: Ditto.
> > > >       * gcc.dg/Warray-bounds-51.c: Ditto.
> > > >       * gcc.dg/Warray-parameter-3.c: Ditto.
> > > >       * gcc.dg/Wstringop-overflow-13.c: Ditto.
> > > >       * gcc.dg/Wstringop-overflow-14.c: Ditto.
> > > >       * gcc.dg/Wstringop-overflow-21.c: Ditto.
> > > >       * gcc.dg/Wstringop-overflow-68.c: Ditto.
> > > >       * gcc.dg/gomp/pr46032-2.c: Ditto.
> > > >       * gcc.dg/gomp/pr46032-3.c: Ditto.
> > > >       * gcc.dg/gomp/simd-2.c: Ditto.
> > > >       * gcc.dg/gomp/simd-3.c: Ditto.
> > > >       * gcc.dg/graphite/fuse-1.c: Ditto.
> > > >       * gcc.dg/pr67089-6.c: Ditto.
> > > >       * gcc.dg/pr82929-2.c: Ditto.
> > > >       * gcc.dg/pr82929.c: Ditto.
> > > >       * gcc.dg/store_merging_1.c: Ditto.
> > > >       * gcc.dg/store_merging_11.c: Ditto.
> > > >       * gcc.dg/store_merging_15.c: Ditto.
> > > >       * gcc.dg/store_merging_16.c: Ditto.
> > > >       * gcc.dg/store_merging_19.c: Ditto.
> > > >       * gcc.dg/store_merging_24.c: Ditto.
> > > >       * gcc.dg/store_merging_25.c: Ditto.
> > > >       * gcc.dg/store_merging_28.c: Ditto.
> > > >       * gcc.dg/store_merging_30.c: Ditto.
> > > >       * gcc.dg/store_merging_5.c: Ditto.
> > > >       * gcc.dg/store_merging_7.c: Ditto.
> > > >       * gcc.dg/store_merging_8.c: Ditto.
> > > >       * gcc.dg/strlenopt-85.c: Ditto.
> > > >       * gcc.dg/tree-ssa/dump-6.c: Ditto.
> > > >       * gcc.dg/tree-ssa/pr19210-1.c: Ditto.
> > > >       * gcc.dg/tree-ssa/pr47059.c: Ditto.
> > > >       * gcc.dg/tree-ssa/pr86017.c: Ditto.
> > > >       * gcc.dg/tree-ssa/pr91482.c: Ditto.
> > > >       * gcc.dg/tree-ssa/predcom-1.c: Ditto.
> > > >       * gcc.dg/tree-ssa/predcom-dse-3.c: Ditto.
> > > >       * gcc.dg/tree-ssa/prefetch-3.c: Ditto.
> > > >       * gcc.dg/tree-ssa/prefetch-6.c: Ditto.
> > > >       * gcc.dg/tree-ssa/prefetch-8.c: Ditto.
> > > >       * gcc.dg/tree-ssa/prefetch-9.c: Ditto.
> > > >       * gcc.dg/tree-ssa/ssa-dse-18.c: Ditto.
> > > >       * gcc.dg/tree-ssa/ssa-dse-19.c: Ditto.
> > > >       * gcc.dg/uninit-40.c: Ditto.
> > > >       * gcc.dg/unroll-7.c: Ditto.
> > > >       * gcc.misc-tests/help.exp: Ditto.
> > > >       * gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
> > > >       * gcc.target/i386/pr22141.c: Ditto.
> > > >       * gcc.target/i386/pr34012.c: Ditto.
> > > >       * gcc.target/i386/pr49781-1.c: Ditto.
> > > >       * gcc.target/i386/pr95798-1.c: Ditto.
> > > >       * gcc.target/i386/pr95798-2.c: Ditto.
> > > >       * gfortran.dg/pr77498.f: Ditto.
> > > > ---
> > > >  gcc/common.opt                                 |  2 +-
> > > >  gcc/doc/invoke.texi                            |  8 +++++---
> > > >  gcc/opts.c                                     | 18 +++++++++++++++---
> > > >  .../c-c++-common/Wstringop-overflow-2.c        |  2 +-
> > > >  gcc/testsuite/g++.dg/tree-ssa/pr81408.C        |  2 +-
> > > >  gcc/testsuite/g++.dg/warn/Wuninitialized-13.C  |  2 +-
> > > >  gcc/testsuite/gcc.dg/Warray-bounds-51.c        |  2 +-
> > > >  gcc/testsuite/gcc.dg/Warray-parameter-3.c      |  2 +-
> > > >  gcc/testsuite/gcc.dg/Wstringop-overflow-13.c   |  2 +-
> > > >  gcc/testsuite/gcc.dg/Wstringop-overflow-14.c   |  2 +-
> > > >  gcc/testsuite/gcc.dg/Wstringop-overflow-21.c   |  2 +-
> > > >  gcc/testsuite/gcc.dg/Wstringop-overflow-68.c   |  2 +-
> > > >  gcc/testsuite/gcc.dg/gomp/pr46032-2.c          |  2 +-
> > > >  gcc/testsuite/gcc.dg/gomp/pr46032-3.c          |  2 +-
> > > >  gcc/testsuite/gcc.dg/gomp/simd-2.c             |  2 +-
> > > >  gcc/testsuite/gcc.dg/gomp/simd-3.c             |  2 +-
> > > >  gcc/testsuite/gcc.dg/graphite/fuse-1.c         |  2 +-
> > > >  gcc/testsuite/gcc.dg/pr67089-6.c               |  2 +-
> > > >  gcc/testsuite/gcc.dg/pr82929-2.c               |  2 +-
> > > >  gcc/testsuite/gcc.dg/pr82929.c                 |  2 +-
> > > >  gcc/testsuite/gcc.dg/store_merging_1.c         |  2 +-
> > > >  gcc/testsuite/gcc.dg/store_merging_11.c        |  2 +-
> > > >  gcc/testsuite/gcc.dg/store_merging_15.c        |  2 +-
> > > >  gcc/testsuite/gcc.dg/store_merging_16.c        |  2 +-
> > > >  gcc/testsuite/gcc.dg/store_merging_19.c        |  2 +-
> > > >  gcc/testsuite/gcc.dg/store_merging_24.c        |  2 +-
> > > >  gcc/testsuite/gcc.dg/store_merging_25.c        |  2 +-
> > > >  gcc/testsuite/gcc.dg/store_merging_28.c        |  2 +-
> > > >  gcc/testsuite/gcc.dg/store_merging_30.c        |  2 +-
> > > >  gcc/testsuite/gcc.dg/store_merging_5.c         |  2 +-
> > > >  gcc/testsuite/gcc.dg/store_merging_7.c         |  2 +-
> > > >  gcc/testsuite/gcc.dg/store_merging_8.c         |  2 +-
> > > >  gcc/testsuite/gcc.dg/strlenopt-85.c            |  2 +-
> > > >  gcc/testsuite/gcc.dg/tree-ssa/dump-6.c         |  2 +-
> > > >  gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c      |  2 +-
> > > >  gcc/testsuite/gcc.dg/tree-ssa/pr47059.c        |  2 +-
> > > >  gcc/testsuite/gcc.dg/tree-ssa/pr86017.c        |  2 +-
> > > >  gcc/testsuite/gcc.dg/tree-ssa/pr91482.c        |  2 +-
> > > >  gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c      |  2 +-
> > > >  gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c  |  2 +-
> > > >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c     |  2 +-
> > > >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c     |  2 +-
> > > >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c     |  2 +-
> > > >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c     |  2 +-
> > > >  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c     |  2 +-
> > > >  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c     |  2 +-
> > > >  gcc/testsuite/gcc.dg/uninit-40.c               |  2 +-
> > > >  gcc/testsuite/gcc.dg/unroll-7.c                |  2 +-
> > > >  gcc/testsuite/gcc.misc-tests/help.exp          |  2 +-
> > > >  .../i386/avx512vpopcntdqvl-vpopcntd-1.c        |  2 +-
> > > >  gcc/testsuite/gcc.target/i386/pr22141.c        |  2 +-
> > > >  gcc/testsuite/gcc.target/i386/pr34012.c        |  2 +-
> > > >  gcc/testsuite/gcc.target/i386/pr49781-1.c      |  2 +-
> > > >  gcc/testsuite/gcc.target/i386/pr95798-1.c      |  2 +-
> > > >  gcc/testsuite/gcc.target/i386/pr95798-2.c      |  2 +-
> > > >  gcc/testsuite/gfortran.dg/pr77498.f            |  2 +-
> > > >  56 files changed, 74 insertions(+), 60 deletions(-)
> > > >
> > > > diff --git a/gcc/common.opt b/gcc/common.opt
> > > > index b921f5e3b25..4f2c0294c29 100644
> > > > --- a/gcc/common.opt
> > > > +++ b/gcc/common.opt
> > > > @@ -3031,7 +3031,7 @@ Perform variable tracking and also tag variables that are uninitialized.
> > > >
> > > >  ; 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/doc/invoke.texi b/gcc/doc/invoke.texi
> > > > index 78cfc100ac2..be022ef8024 100644
> > > > --- a/gcc/doc/invoke.texi
> > > > +++ b/gcc/doc/invoke.texi
> > > > @@ -10409,9 +10409,13 @@ also turns on the following optimization flags:
> > > >  -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 @gol
> > >
> > > the above is redundant
> > >
> > > > +-fvect-cost-model=very-cheap}
> > > >
> > > >  Please note the warning under @option{-fgcse} about
> > > >  invoking @option{-O2} on programs that use computed gotos.
> > > > @@ -10431,9 +10435,7 @@ by @option{-O2} and also turns on the following optimization flags:
> > > >  -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
> > >
> > > likewise - so just remove it here as you are around
> > >
> > > >  -fvect-cost-model=dynamic @gol
> > > > diff --git a/gcc/opts.c b/gcc/opts.c
> > > > index 1d2d22d7a3f..cee372a3235 100644
> > > > --- a/gcc/opts.c
> > > > +++ b/gcc/opts.c
> > > > @@ -634,7 +634,8 @@ static const struct default_options default_options_table[] =
> > > >      { 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,9 @@ static const struct default_options default_options_table[] =
> > > >      { 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 +667,7 @@ static const struct default_options default_options_table[] =
> > > >      { 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 },
> > > > @@ -1331,6 +1333,16 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
> > > >        = (opts->x_flag_unroll_loops
> > > >           || opts->x_flag_peel_loops
> > > >           || opts->x_optimize >= 3);
> > > > +
> > > > +  /* 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);
> > > > +
> > > > +
> > >
> > > please avoid adding excessive vertical space at the end of the function
> > >
> > > >  }
> > > >
> > > >  #define LEFT_COLUMN  27
> > > > diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > > index 1d79930cd58..9351f7e7a1a 100644
> > > > --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > > +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > > @@ -1,7 +1,7 @@
> > > >  /* PR middle-end/91458 - inconsistent warning for writing past the end
> > > >     of an array member
> > > >     { dg-do compile }
> > > > -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
> > > > +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
> > >
> > > The testcase is large - what part requires this change?  Given the
> > > testcase was added for inconsistent warnings do they now become
> > > inconsistent again as we enable vectorization at -O2?
> > >
> > > That said, the testcase adjustments need some explaining - I suppose
> > > you didn't just slap -fno-tree-vectorize to all of those changing
> > > behavior?
> > >
> > void ga1_ (void)
> > {
> >   a1_.a[0] = 0;
> >   a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
> >   a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
> >
> >   struct A1 a;
> >   a.a[0] = 0;
> >   a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
> >   a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
> >   sink (&a);
> > }
> >
> > It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
> > there are 2 accesses, but after enabling vectorization, there's only
> > one access, so one warning is missing which causes the failure.
> >
> >    <bb 2> [local count: 1073741824]:
> >   a1__.a[0] = 0;
> >   a1__.a[1] = 1;
> >   a1__.a[2] = 2;
> >   MEM <char[1]> [(struct A1 *)&a + 1B] = {};
> >   a.n = 1;
> >   MEM <vector(2) char> [(char *)&a + 2B] = { 1, 2 };
> >   sink (&a);
> >   a ={v} {CLOBBER};
> >   return;
>
> I see, so it seems you looked into each instance you changed - I don't
> want to repeat that exercise here.
>
Going through all testcases i changed, i found 3 miss optimization
issue after enable O2 vectorization. The issues are recorded in
pr102382/pr102382/pr102384, I'm not sure if they're block issues which
needed to be solved first before installing the patch.
Also I notice  openmp case gcc.dg/gomp/simd-3.c #pragma omp for simd
will enable vectorization for the region w/ original cost model cheap,
but now cost model is very cheap, would that be ok?

> Thus the patch is OK with the minor nits I had fixed.  Note that
> other targets testsuites likely will need similar adjustments so
> please watch out (but a lot of target people are in CC and could
> deal with such fallout themselves).
>
> Please also prepare an entry for gcc-12/changes.html since this
> is an important change.  Make sure to mention -fvect-cost-model
> since otherwise people might expect vectorization to be as good
> as with -O3.
>
> Thanks,
> Richard.
>
> >
> > > Thanks,
> > > Richard.
> > >
> > > >  void sink (void*);
> > > >
> > > > diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
> > > > index 39e32fd4bc9..bc14309480c 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 49ee878806a..60e8dd4f0e2 100644
> > > > --- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> > > > +++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> > > > @@ -1,6 +1,6 @@
> > > >  /* PR c/98597 - ICE in -Wuninitialized printing a MEM_REF
> > > >     { dg-do compile }
> > > > -   { dg-options "-O2 -Wall" } */
> > > > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> > > >
> > > >  struct shared_count {
> > > >    shared_count () { }
> > > > diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-51.c b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > > > index 6028b11637c..8b81a0ccfa7 100644
> > > > --- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > > > +++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > > > @@ -1,7 +1,7 @@
> > > >  /* PR middle-end/92333 - missing variable name referencing VLA in warnings
> > > >     PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
> > > >     { dg-do compile }
> > > > -   { dg-options "-O2 -Wall" } */
> > > > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> > > >
> > > >  void sink (void*);
> > > >
> > > > diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-3.c b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > > > index cbf3e9339f5..fbef715aa99 100644
> > > > --- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > > > +++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > > > @@ -59,7 +59,7 @@ void fas1 (int[static 2]);    // { dg-warning "\\\[-Warray-parameter=" }
> > > >
> > > >  /* Also verify that -Warray-bounds doesn't trigger for ordinary array
> > > >     parameters...  */
> > > > -#pragma GCC optimize "2"
> > > > +#pragma GCC optimize ("2,-fno-tree-vectorize")
> > > >
> > > >  __attribute__ ((noipa)) void
> > > >  gca3 (char a[3])
> > > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > > > index bd513151cea..a78242bf26e 100644
> > > > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > > > @@ -3,7 +3,7 @@
> > > >     PR middle-end/89911 - ICE on a call with no arguments to strnlen
> > > >     declared with no prototype
> > > >     { dg-do compile }
> > > > -   { dg-options "-O2 -Wall" } */
> > > > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> > > >
> > > >  typedef __SIZE_TYPE__ size_t;
> > > >
> > > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > > > index d6201b068b6..808bf87c386 100644
> > > > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > > > @@ -2,7 +2,7 @@
> > > >     types than char are diagnosed.
> > > >     { dg-do compile }
> > > >     { dg-require-effective-target int32plus }
> > > > -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> > > > +   { dg-options "-O2 -fno-tree-vectorize -Wall -Wno-array-bounds" } */
> > > >
> > > >  typedef __INT16_TYPE__  int16_t;
> > > >  typedef __INT32_TYPE__  int32_t;
> > > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > > > index 3a27460220c..f418a17ca93 100644
> > > > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > > > @@ -1,7 +1,7 @@
> > > >  /* PR middle-end/92312 - bogus -Wstringop-overflow storing into a trailing
> > > >     array backed by larger buffer
> > > >     { dg-do compile }
> > > > -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> > > > +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-tree-vectorize" } */
> > > >
> > > >  struct S0 { char a, b[0]; };
> > > >
> > > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > > > index 6bcba274541..7cc1012130c 100644
> > > > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > > > @@ -2,7 +2,7 @@
> > > >     a larger scalar into a smaller array
> > > >     Verify overflow by aggregate stores.
> > > >     { dg-do compile }
> > > > -   { dg-options "-O2" } */
> > > > +   { dg-options "-O2 -fno-tree-vectorize" } */
> > > >
> > > >  #define A(N) (A ## N)
> > > >  #define Ac1 (AC1){ 0 }
> > > > diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
> > > > index e110880bd8e..2e562618489 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 a4af7ec4a8a..da1ab487385 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 85acb980f10..f4912127b81 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 86fee858673..c75060c07ae 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 527b6e5c415..61289d312c2 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 db2ffdfeca4..b59d75b2318 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 3442f91af02..b886f1cce76 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 bb84f2b21a3..123e1919cec 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 4cc43dfd9e1..91ca925be0e 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 2ec2394afb9..60ed5cd8bf9 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_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
> > > > index acd7de571f8..13fcca4aa11 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 9545dcce3de..cd83f1c0fe5 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 0841bb4deee..0a2bbc4bfde 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 744fe60e8e0..5291bb9e986 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 cf182190e91..96611b5e57b 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 2d6cffc4694..fadb7fff993 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 694d560a621..baf94efe733 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 6e7c72510ff..b0cb0da78e0 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 c744ece6407..dbe000a463e 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 e710a544ff0..d719e0a2257 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 e049e0c30e0..2ba1ee05700 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 70659c00c0e..6c803908781 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 50d86a00485..b9e40e964c1 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 9f9c61aa213..860cde12c0f 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 f216e83c7b3..c7ef73ad59e 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 7d6a724e4ad..0ddad573129 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 f68be2b3379..8c3d9a4fc58 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 ec08d6c0318..1fc8f089345 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 467903bf3fc..46f0d0c2317 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 12f09016943..3fa71685ace 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 cbd6a80d345..00f41c3e4f4 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 da4847320b1..e8848c30acc 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 92b2df80ec8..2e7b5b496ea 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 718b7466e50..7bb8d060631 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 c015191ca32..8708079d397 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 055369bf8b1..695af5757cc 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 5e034d26947..eb6d8686c6a 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=target,optimizers" "" "" ""
> > > >  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 709cd21e671..a732bc466db 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/pr22141.c b/gcc/testsuite/gcc.target/i386/pr22141.c
> > > > index 036422e8ccf..b68b97f3f72 100644
> > > > --- a/gcc/testsuite/gcc.target/i386/pr22141.c
> > > > +++ b/gcc/testsuite/gcc.target/i386/pr22141.c
> > > > @@ -1,6 +1,6 @@
> > > >  /* PR middle-end/22141 */
> > > >  /* { dg-do compile } */
> > > > -/* { dg-options "-Os" } */
> > > > +/* { dg-options "-Os -fno-tree-vectorize" } */
> > > >
> > > >  extern void abort (void);
> > > >
> > > > diff --git a/gcc/testsuite/gcc.target/i386/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
> > > > index d0cffa05290..1c1f0eea52e 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 60f9d50d866..d5a2e32db97 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 9a7e32d6f2f..526f48921fd 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 c670d3780e8..6b5c5a73e96 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 f957b57bb00..a0fc8275a84 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
> > > >
> > >
> > > --
> > > Richard Biener <rguenther@suse.de>
> > > SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
> > > Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)
> >
> >
> >
> >
>
> --
> Richard Biener <rguenther@suse.de>
> SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
> Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)



-- 
BR,
Hongtao

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-16  9:03   ` Hongtao Liu
@ 2021-09-16 12:31     ` Richard Biener
  2021-09-17  3:26       ` Hongtao Liu
  2021-09-19 20:13     ` Martin Sebor
  1 sibling, 1 reply; 39+ messages in thread
From: Richard Biener @ 2021-09-16 12:31 UTC (permalink / raw)
  To: Hongtao Liu
  Cc: liuhongt, Jakub Jelinek, Florian Weimer, Segher Boessenkool,
	Richard Sandiford, Premachandra.Mallappa, GCC Patches,
	Bill Schmidt, Joseph Myers

On Thu, 16 Sep 2021, Hongtao Liu wrote:

> On Thu, Sep 16, 2021 at 4:23 PM Richard Biener via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> >
> > On Thu, 16 Sep 2021, liuhongt wrote:
> >
> > > Ping
> > > rebased on latest trunk.
> > >
> > > gcc/ChangeLog:
> > >
> > >       * common.opt (ftree-vectorize): Add Var(flag_tree_vectorize).
> > >       * doc/invoke.texi (Options That Control Optimization): Update
> > >       documents.
> > >       * opts.c (default_options_table): Enable auto-vectorization at
> > >       O2 with very-cheap cost model.
> > >       (finish_options): Use cheap cost model for
> > >       explicit -ftree{,-loop}-vectorize.
> > >
> > > gcc/testsuite/ChangeLog:
> > >
> > >       * c-c++-common/Wstringop-overflow-2.c: Adjust testcase.
> > >       * g++.dg/tree-ssa/pr81408.C: Ditto.
> > >       * g++.dg/warn/Wuninitialized-13.C: Ditto.
> > >       * gcc.dg/Warray-bounds-51.c: Ditto.
> > >       * gcc.dg/Warray-parameter-3.c: Ditto.
> > >       * gcc.dg/Wstringop-overflow-13.c: Ditto.
> > >       * gcc.dg/Wstringop-overflow-14.c: Ditto.
> > >       * gcc.dg/Wstringop-overflow-21.c: Ditto.
> > >       * gcc.dg/Wstringop-overflow-68.c: Ditto.
> > >       * gcc.dg/gomp/pr46032-2.c: Ditto.
> > >       * gcc.dg/gomp/pr46032-3.c: Ditto.
> > >       * gcc.dg/gomp/simd-2.c: Ditto.
> > >       * gcc.dg/gomp/simd-3.c: Ditto.
> > >       * gcc.dg/graphite/fuse-1.c: Ditto.
> > >       * gcc.dg/pr67089-6.c: Ditto.
> > >       * gcc.dg/pr82929-2.c: Ditto.
> > >       * gcc.dg/pr82929.c: Ditto.
> > >       * gcc.dg/store_merging_1.c: Ditto.
> > >       * gcc.dg/store_merging_11.c: Ditto.
> > >       * gcc.dg/store_merging_15.c: Ditto.
> > >       * gcc.dg/store_merging_16.c: Ditto.
> > >       * gcc.dg/store_merging_19.c: Ditto.
> > >       * gcc.dg/store_merging_24.c: Ditto.
> > >       * gcc.dg/store_merging_25.c: Ditto.
> > >       * gcc.dg/store_merging_28.c: Ditto.
> > >       * gcc.dg/store_merging_30.c: Ditto.
> > >       * gcc.dg/store_merging_5.c: Ditto.
> > >       * gcc.dg/store_merging_7.c: Ditto.
> > >       * gcc.dg/store_merging_8.c: Ditto.
> > >       * gcc.dg/strlenopt-85.c: Ditto.
> > >       * gcc.dg/tree-ssa/dump-6.c: Ditto.
> > >       * gcc.dg/tree-ssa/pr19210-1.c: Ditto.
> > >       * gcc.dg/tree-ssa/pr47059.c: Ditto.
> > >       * gcc.dg/tree-ssa/pr86017.c: Ditto.
> > >       * gcc.dg/tree-ssa/pr91482.c: Ditto.
> > >       * gcc.dg/tree-ssa/predcom-1.c: Ditto.
> > >       * gcc.dg/tree-ssa/predcom-dse-3.c: Ditto.
> > >       * gcc.dg/tree-ssa/prefetch-3.c: Ditto.
> > >       * gcc.dg/tree-ssa/prefetch-6.c: Ditto.
> > >       * gcc.dg/tree-ssa/prefetch-8.c: Ditto.
> > >       * gcc.dg/tree-ssa/prefetch-9.c: Ditto.
> > >       * gcc.dg/tree-ssa/ssa-dse-18.c: Ditto.
> > >       * gcc.dg/tree-ssa/ssa-dse-19.c: Ditto.
> > >       * gcc.dg/uninit-40.c: Ditto.
> > >       * gcc.dg/unroll-7.c: Ditto.
> > >       * gcc.misc-tests/help.exp: Ditto.
> > >       * gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
> > >       * gcc.target/i386/pr22141.c: Ditto.
> > >       * gcc.target/i386/pr34012.c: Ditto.
> > >       * gcc.target/i386/pr49781-1.c: Ditto.
> > >       * gcc.target/i386/pr95798-1.c: Ditto.
> > >       * gcc.target/i386/pr95798-2.c: Ditto.
> > >       * gfortran.dg/pr77498.f: Ditto.
> > > ---
> > >  gcc/common.opt                                 |  2 +-
> > >  gcc/doc/invoke.texi                            |  8 +++++---
> > >  gcc/opts.c                                     | 18 +++++++++++++++---
> > >  .../c-c++-common/Wstringop-overflow-2.c        |  2 +-
> > >  gcc/testsuite/g++.dg/tree-ssa/pr81408.C        |  2 +-
> > >  gcc/testsuite/g++.dg/warn/Wuninitialized-13.C  |  2 +-
> > >  gcc/testsuite/gcc.dg/Warray-bounds-51.c        |  2 +-
> > >  gcc/testsuite/gcc.dg/Warray-parameter-3.c      |  2 +-
> > >  gcc/testsuite/gcc.dg/Wstringop-overflow-13.c   |  2 +-
> > >  gcc/testsuite/gcc.dg/Wstringop-overflow-14.c   |  2 +-
> > >  gcc/testsuite/gcc.dg/Wstringop-overflow-21.c   |  2 +-
> > >  gcc/testsuite/gcc.dg/Wstringop-overflow-68.c   |  2 +-
> > >  gcc/testsuite/gcc.dg/gomp/pr46032-2.c          |  2 +-
> > >  gcc/testsuite/gcc.dg/gomp/pr46032-3.c          |  2 +-
> > >  gcc/testsuite/gcc.dg/gomp/simd-2.c             |  2 +-
> > >  gcc/testsuite/gcc.dg/gomp/simd-3.c             |  2 +-
> > >  gcc/testsuite/gcc.dg/graphite/fuse-1.c         |  2 +-
> > >  gcc/testsuite/gcc.dg/pr67089-6.c               |  2 +-
> > >  gcc/testsuite/gcc.dg/pr82929-2.c               |  2 +-
> > >  gcc/testsuite/gcc.dg/pr82929.c                 |  2 +-
> > >  gcc/testsuite/gcc.dg/store_merging_1.c         |  2 +-
> > >  gcc/testsuite/gcc.dg/store_merging_11.c        |  2 +-
> > >  gcc/testsuite/gcc.dg/store_merging_15.c        |  2 +-
> > >  gcc/testsuite/gcc.dg/store_merging_16.c        |  2 +-
> > >  gcc/testsuite/gcc.dg/store_merging_19.c        |  2 +-
> > >  gcc/testsuite/gcc.dg/store_merging_24.c        |  2 +-
> > >  gcc/testsuite/gcc.dg/store_merging_25.c        |  2 +-
> > >  gcc/testsuite/gcc.dg/store_merging_28.c        |  2 +-
> > >  gcc/testsuite/gcc.dg/store_merging_30.c        |  2 +-
> > >  gcc/testsuite/gcc.dg/store_merging_5.c         |  2 +-
> > >  gcc/testsuite/gcc.dg/store_merging_7.c         |  2 +-
> > >  gcc/testsuite/gcc.dg/store_merging_8.c         |  2 +-
> > >  gcc/testsuite/gcc.dg/strlenopt-85.c            |  2 +-
> > >  gcc/testsuite/gcc.dg/tree-ssa/dump-6.c         |  2 +-
> > >  gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c      |  2 +-
> > >  gcc/testsuite/gcc.dg/tree-ssa/pr47059.c        |  2 +-
> > >  gcc/testsuite/gcc.dg/tree-ssa/pr86017.c        |  2 +-
> > >  gcc/testsuite/gcc.dg/tree-ssa/pr91482.c        |  2 +-
> > >  gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c      |  2 +-
> > >  gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c  |  2 +-
> > >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c     |  2 +-
> > >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c     |  2 +-
> > >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c     |  2 +-
> > >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c     |  2 +-
> > >  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c     |  2 +-
> > >  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c     |  2 +-
> > >  gcc/testsuite/gcc.dg/uninit-40.c               |  2 +-
> > >  gcc/testsuite/gcc.dg/unroll-7.c                |  2 +-
> > >  gcc/testsuite/gcc.misc-tests/help.exp          |  2 +-
> > >  .../i386/avx512vpopcntdqvl-vpopcntd-1.c        |  2 +-
> > >  gcc/testsuite/gcc.target/i386/pr22141.c        |  2 +-
> > >  gcc/testsuite/gcc.target/i386/pr34012.c        |  2 +-
> > >  gcc/testsuite/gcc.target/i386/pr49781-1.c      |  2 +-
> > >  gcc/testsuite/gcc.target/i386/pr95798-1.c      |  2 +-
> > >  gcc/testsuite/gcc.target/i386/pr95798-2.c      |  2 +-
> > >  gcc/testsuite/gfortran.dg/pr77498.f            |  2 +-
> > >  56 files changed, 74 insertions(+), 60 deletions(-)
> > >
> > > diff --git a/gcc/common.opt b/gcc/common.opt
> > > index b921f5e3b25..4f2c0294c29 100644
> > > --- a/gcc/common.opt
> > > +++ b/gcc/common.opt
> > > @@ -3031,7 +3031,7 @@ Perform variable tracking and also tag variables that are uninitialized.
> > >
> > >  ; 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/doc/invoke.texi b/gcc/doc/invoke.texi
> > > index 78cfc100ac2..be022ef8024 100644
> > > --- a/gcc/doc/invoke.texi
> > > +++ b/gcc/doc/invoke.texi
> > > @@ -10409,9 +10409,13 @@ also turns on the following optimization flags:
> > >  -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 @gol
> >
> > the above is redundant
> >
> > > +-fvect-cost-model=very-cheap}
> > >
> > >  Please note the warning under @option{-fgcse} about
> > >  invoking @option{-O2} on programs that use computed gotos.
> > > @@ -10431,9 +10435,7 @@ by @option{-O2} and also turns on the following optimization flags:
> > >  -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
> >
> > likewise - so just remove it here as you are around
> >
> > >  -fvect-cost-model=dynamic @gol
> > > diff --git a/gcc/opts.c b/gcc/opts.c
> > > index 1d2d22d7a3f..cee372a3235 100644
> > > --- a/gcc/opts.c
> > > +++ b/gcc/opts.c
> > > @@ -634,7 +634,8 @@ static const struct default_options default_options_table[] =
> > >      { 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,9 @@ static const struct default_options default_options_table[] =
> > >      { 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 +667,7 @@ static const struct default_options default_options_table[] =
> > >      { 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 },
> > > @@ -1331,6 +1333,16 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
> > >        = (opts->x_flag_unroll_loops
> > >           || opts->x_flag_peel_loops
> > >           || opts->x_optimize >= 3);
> > > +
> > > +  /* 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);
> > > +
> > > +
> >
> > please avoid adding excessive vertical space at the end of the function
> >
> > >  }
> > >
> > >  #define LEFT_COLUMN  27
> > > diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > index 1d79930cd58..9351f7e7a1a 100644
> > > --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > > @@ -1,7 +1,7 @@
> > >  /* PR middle-end/91458 - inconsistent warning for writing past the end
> > >     of an array member
> > >     { dg-do compile }
> > > -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
> > > +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
> >
> > The testcase is large - what part requires this change?  Given the
> > testcase was added for inconsistent warnings do they now become
> > inconsistent again as we enable vectorization at -O2?
> >
> > That said, the testcase adjustments need some explaining - I suppose
> > you didn't just slap -fno-tree-vectorize to all of those changing
> > behavior?
> >
> void ga1_ (void)
> {
>   a1_.a[0] = 0;
>   a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
>   a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }
> 
>   struct A1 a;
>   a.a[0] = 0;
>   a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
>   a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
>   sink (&a);
> }
> 
> It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
> there are 2 accesses, but after enabling vectorization, there's only
> one access, so one warning is missing which causes the failure.
> 
>    <bb 2> [local count: 1073741824]:
>   a1__.a[0] = 0;
>   a1__.a[1] = 1;
>   a1__.a[2] = 2;
>   MEM <char[1]> [(struct A1 *)&a + 1B] = {};
>   a.n = 1;
>   MEM <vector(2) char> [(char *)&a + 2B] = { 1, 2 };
>   sink (&a);
>   a ={v} {CLOBBER};
>   return;

I see, so it seems you looked into each instance you changed - I don't
want to repeat that exercise here.

Thus the patch is OK with the minor nits I had fixed.  Note that
other targets testsuites likely will need similar adjustments so
please watch out (but a lot of target people are in CC and could
deal with such fallout themselves).

Please also prepare an entry for gcc-12/changes.html since this
is an important change.  Make sure to mention -fvect-cost-model
since otherwise people might expect vectorization to be as good
as with -O3.

Thanks,
Richard.

> 
> > Thanks,
> > Richard.
> >
> > >  void sink (void*);
> > >
> > > diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
> > > index 39e32fd4bc9..bc14309480c 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 49ee878806a..60e8dd4f0e2 100644
> > > --- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> > > +++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> > > @@ -1,6 +1,6 @@
> > >  /* PR c/98597 - ICE in -Wuninitialized printing a MEM_REF
> > >     { dg-do compile }
> > > -   { dg-options "-O2 -Wall" } */
> > > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> > >
> > >  struct shared_count {
> > >    shared_count () { }
> > > diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-51.c b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > > index 6028b11637c..8b81a0ccfa7 100644
> > > --- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > > +++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > > @@ -1,7 +1,7 @@
> > >  /* PR middle-end/92333 - missing variable name referencing VLA in warnings
> > >     PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
> > >     { dg-do compile }
> > > -   { dg-options "-O2 -Wall" } */
> > > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> > >
> > >  void sink (void*);
> > >
> > > diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-3.c b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > > index cbf3e9339f5..fbef715aa99 100644
> > > --- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > > +++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > > @@ -59,7 +59,7 @@ void fas1 (int[static 2]);    // { dg-warning "\\\[-Warray-parameter=" }
> > >
> > >  /* Also verify that -Warray-bounds doesn't trigger for ordinary array
> > >     parameters...  */
> > > -#pragma GCC optimize "2"
> > > +#pragma GCC optimize ("2,-fno-tree-vectorize")
> > >
> > >  __attribute__ ((noipa)) void
> > >  gca3 (char a[3])
> > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > > index bd513151cea..a78242bf26e 100644
> > > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > > @@ -3,7 +3,7 @@
> > >     PR middle-end/89911 - ICE on a call with no arguments to strnlen
> > >     declared with no prototype
> > >     { dg-do compile }
> > > -   { dg-options "-O2 -Wall" } */
> > > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> > >
> > >  typedef __SIZE_TYPE__ size_t;
> > >
> > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > > index d6201b068b6..808bf87c386 100644
> > > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > > @@ -2,7 +2,7 @@
> > >     types than char are diagnosed.
> > >     { dg-do compile }
> > >     { dg-require-effective-target int32plus }
> > > -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> > > +   { dg-options "-O2 -fno-tree-vectorize -Wall -Wno-array-bounds" } */
> > >
> > >  typedef __INT16_TYPE__  int16_t;
> > >  typedef __INT32_TYPE__  int32_t;
> > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > > index 3a27460220c..f418a17ca93 100644
> > > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > > @@ -1,7 +1,7 @@
> > >  /* PR middle-end/92312 - bogus -Wstringop-overflow storing into a trailing
> > >     array backed by larger buffer
> > >     { dg-do compile }
> > > -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> > > +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-tree-vectorize" } */
> > >
> > >  struct S0 { char a, b[0]; };
> > >
> > > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > > index 6bcba274541..7cc1012130c 100644
> > > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > > @@ -2,7 +2,7 @@
> > >     a larger scalar into a smaller array
> > >     Verify overflow by aggregate stores.
> > >     { dg-do compile }
> > > -   { dg-options "-O2" } */
> > > +   { dg-options "-O2 -fno-tree-vectorize" } */
> > >
> > >  #define A(N) (A ## N)
> > >  #define Ac1 (AC1){ 0 }
> > > diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
> > > index e110880bd8e..2e562618489 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 a4af7ec4a8a..da1ab487385 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 85acb980f10..f4912127b81 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 86fee858673..c75060c07ae 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 527b6e5c415..61289d312c2 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 db2ffdfeca4..b59d75b2318 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 3442f91af02..b886f1cce76 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 bb84f2b21a3..123e1919cec 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 4cc43dfd9e1..91ca925be0e 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 2ec2394afb9..60ed5cd8bf9 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_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
> > > index acd7de571f8..13fcca4aa11 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 9545dcce3de..cd83f1c0fe5 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 0841bb4deee..0a2bbc4bfde 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 744fe60e8e0..5291bb9e986 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 cf182190e91..96611b5e57b 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 2d6cffc4694..fadb7fff993 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 694d560a621..baf94efe733 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 6e7c72510ff..b0cb0da78e0 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 c744ece6407..dbe000a463e 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 e710a544ff0..d719e0a2257 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 e049e0c30e0..2ba1ee05700 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 70659c00c0e..6c803908781 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 50d86a00485..b9e40e964c1 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 9f9c61aa213..860cde12c0f 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 f216e83c7b3..c7ef73ad59e 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 7d6a724e4ad..0ddad573129 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 f68be2b3379..8c3d9a4fc58 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 ec08d6c0318..1fc8f089345 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 467903bf3fc..46f0d0c2317 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 12f09016943..3fa71685ace 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 cbd6a80d345..00f41c3e4f4 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 da4847320b1..e8848c30acc 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 92b2df80ec8..2e7b5b496ea 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 718b7466e50..7bb8d060631 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 c015191ca32..8708079d397 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 055369bf8b1..695af5757cc 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 5e034d26947..eb6d8686c6a 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=target,optimizers" "" "" ""
> > >  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 709cd21e671..a732bc466db 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/pr22141.c b/gcc/testsuite/gcc.target/i386/pr22141.c
> > > index 036422e8ccf..b68b97f3f72 100644
> > > --- a/gcc/testsuite/gcc.target/i386/pr22141.c
> > > +++ b/gcc/testsuite/gcc.target/i386/pr22141.c
> > > @@ -1,6 +1,6 @@
> > >  /* PR middle-end/22141 */
> > >  /* { dg-do compile } */
> > > -/* { dg-options "-Os" } */
> > > +/* { dg-options "-Os -fno-tree-vectorize" } */
> > >
> > >  extern void abort (void);
> > >
> > > diff --git a/gcc/testsuite/gcc.target/i386/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
> > > index d0cffa05290..1c1f0eea52e 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 60f9d50d866..d5a2e32db97 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 9a7e32d6f2f..526f48921fd 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 c670d3780e8..6b5c5a73e96 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 f957b57bb00..a0fc8275a84 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
> > >
> >
> > --
> > Richard Biener <rguenther@suse.de>
> > SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
> > Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)
> 
> 
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-16  8:22 ` Richard Biener
@ 2021-09-16  9:03   ` Hongtao Liu
  2021-09-16 12:31     ` Richard Biener
  2021-09-19 20:13     ` Martin Sebor
  0 siblings, 2 replies; 39+ messages in thread
From: Hongtao Liu @ 2021-09-16  9:03 UTC (permalink / raw)
  To: Richard Biener
  Cc: liuhongt, Jakub Jelinek, Florian Weimer, Segher Boessenkool,
	Richard Sandiford, Premachandra.Mallappa, GCC Patches,
	Bill Schmidt, Joseph Myers

On Thu, Sep 16, 2021 at 4:23 PM Richard Biener via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Thu, 16 Sep 2021, liuhongt wrote:
>
> > Ping
> > rebased on latest trunk.
> >
> > gcc/ChangeLog:
> >
> >       * common.opt (ftree-vectorize): Add Var(flag_tree_vectorize).
> >       * doc/invoke.texi (Options That Control Optimization): Update
> >       documents.
> >       * opts.c (default_options_table): Enable auto-vectorization at
> >       O2 with very-cheap cost model.
> >       (finish_options): Use cheap cost model for
> >       explicit -ftree{,-loop}-vectorize.
> >
> > gcc/testsuite/ChangeLog:
> >
> >       * c-c++-common/Wstringop-overflow-2.c: Adjust testcase.
> >       * g++.dg/tree-ssa/pr81408.C: Ditto.
> >       * g++.dg/warn/Wuninitialized-13.C: Ditto.
> >       * gcc.dg/Warray-bounds-51.c: Ditto.
> >       * gcc.dg/Warray-parameter-3.c: Ditto.
> >       * gcc.dg/Wstringop-overflow-13.c: Ditto.
> >       * gcc.dg/Wstringop-overflow-14.c: Ditto.
> >       * gcc.dg/Wstringop-overflow-21.c: Ditto.
> >       * gcc.dg/Wstringop-overflow-68.c: Ditto.
> >       * gcc.dg/gomp/pr46032-2.c: Ditto.
> >       * gcc.dg/gomp/pr46032-3.c: Ditto.
> >       * gcc.dg/gomp/simd-2.c: Ditto.
> >       * gcc.dg/gomp/simd-3.c: Ditto.
> >       * gcc.dg/graphite/fuse-1.c: Ditto.
> >       * gcc.dg/pr67089-6.c: Ditto.
> >       * gcc.dg/pr82929-2.c: Ditto.
> >       * gcc.dg/pr82929.c: Ditto.
> >       * gcc.dg/store_merging_1.c: Ditto.
> >       * gcc.dg/store_merging_11.c: Ditto.
> >       * gcc.dg/store_merging_15.c: Ditto.
> >       * gcc.dg/store_merging_16.c: Ditto.
> >       * gcc.dg/store_merging_19.c: Ditto.
> >       * gcc.dg/store_merging_24.c: Ditto.
> >       * gcc.dg/store_merging_25.c: Ditto.
> >       * gcc.dg/store_merging_28.c: Ditto.
> >       * gcc.dg/store_merging_30.c: Ditto.
> >       * gcc.dg/store_merging_5.c: Ditto.
> >       * gcc.dg/store_merging_7.c: Ditto.
> >       * gcc.dg/store_merging_8.c: Ditto.
> >       * gcc.dg/strlenopt-85.c: Ditto.
> >       * gcc.dg/tree-ssa/dump-6.c: Ditto.
> >       * gcc.dg/tree-ssa/pr19210-1.c: Ditto.
> >       * gcc.dg/tree-ssa/pr47059.c: Ditto.
> >       * gcc.dg/tree-ssa/pr86017.c: Ditto.
> >       * gcc.dg/tree-ssa/pr91482.c: Ditto.
> >       * gcc.dg/tree-ssa/predcom-1.c: Ditto.
> >       * gcc.dg/tree-ssa/predcom-dse-3.c: Ditto.
> >       * gcc.dg/tree-ssa/prefetch-3.c: Ditto.
> >       * gcc.dg/tree-ssa/prefetch-6.c: Ditto.
> >       * gcc.dg/tree-ssa/prefetch-8.c: Ditto.
> >       * gcc.dg/tree-ssa/prefetch-9.c: Ditto.
> >       * gcc.dg/tree-ssa/ssa-dse-18.c: Ditto.
> >       * gcc.dg/tree-ssa/ssa-dse-19.c: Ditto.
> >       * gcc.dg/uninit-40.c: Ditto.
> >       * gcc.dg/unroll-7.c: Ditto.
> >       * gcc.misc-tests/help.exp: Ditto.
> >       * gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
> >       * gcc.target/i386/pr22141.c: Ditto.
> >       * gcc.target/i386/pr34012.c: Ditto.
> >       * gcc.target/i386/pr49781-1.c: Ditto.
> >       * gcc.target/i386/pr95798-1.c: Ditto.
> >       * gcc.target/i386/pr95798-2.c: Ditto.
> >       * gfortran.dg/pr77498.f: Ditto.
> > ---
> >  gcc/common.opt                                 |  2 +-
> >  gcc/doc/invoke.texi                            |  8 +++++---
> >  gcc/opts.c                                     | 18 +++++++++++++++---
> >  .../c-c++-common/Wstringop-overflow-2.c        |  2 +-
> >  gcc/testsuite/g++.dg/tree-ssa/pr81408.C        |  2 +-
> >  gcc/testsuite/g++.dg/warn/Wuninitialized-13.C  |  2 +-
> >  gcc/testsuite/gcc.dg/Warray-bounds-51.c        |  2 +-
> >  gcc/testsuite/gcc.dg/Warray-parameter-3.c      |  2 +-
> >  gcc/testsuite/gcc.dg/Wstringop-overflow-13.c   |  2 +-
> >  gcc/testsuite/gcc.dg/Wstringop-overflow-14.c   |  2 +-
> >  gcc/testsuite/gcc.dg/Wstringop-overflow-21.c   |  2 +-
> >  gcc/testsuite/gcc.dg/Wstringop-overflow-68.c   |  2 +-
> >  gcc/testsuite/gcc.dg/gomp/pr46032-2.c          |  2 +-
> >  gcc/testsuite/gcc.dg/gomp/pr46032-3.c          |  2 +-
> >  gcc/testsuite/gcc.dg/gomp/simd-2.c             |  2 +-
> >  gcc/testsuite/gcc.dg/gomp/simd-3.c             |  2 +-
> >  gcc/testsuite/gcc.dg/graphite/fuse-1.c         |  2 +-
> >  gcc/testsuite/gcc.dg/pr67089-6.c               |  2 +-
> >  gcc/testsuite/gcc.dg/pr82929-2.c               |  2 +-
> >  gcc/testsuite/gcc.dg/pr82929.c                 |  2 +-
> >  gcc/testsuite/gcc.dg/store_merging_1.c         |  2 +-
> >  gcc/testsuite/gcc.dg/store_merging_11.c        |  2 +-
> >  gcc/testsuite/gcc.dg/store_merging_15.c        |  2 +-
> >  gcc/testsuite/gcc.dg/store_merging_16.c        |  2 +-
> >  gcc/testsuite/gcc.dg/store_merging_19.c        |  2 +-
> >  gcc/testsuite/gcc.dg/store_merging_24.c        |  2 +-
> >  gcc/testsuite/gcc.dg/store_merging_25.c        |  2 +-
> >  gcc/testsuite/gcc.dg/store_merging_28.c        |  2 +-
> >  gcc/testsuite/gcc.dg/store_merging_30.c        |  2 +-
> >  gcc/testsuite/gcc.dg/store_merging_5.c         |  2 +-
> >  gcc/testsuite/gcc.dg/store_merging_7.c         |  2 +-
> >  gcc/testsuite/gcc.dg/store_merging_8.c         |  2 +-
> >  gcc/testsuite/gcc.dg/strlenopt-85.c            |  2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/dump-6.c         |  2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c      |  2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/pr47059.c        |  2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/pr86017.c        |  2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/pr91482.c        |  2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c      |  2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c  |  2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c     |  2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c     |  2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c     |  2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c     |  2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c     |  2 +-
> >  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c     |  2 +-
> >  gcc/testsuite/gcc.dg/uninit-40.c               |  2 +-
> >  gcc/testsuite/gcc.dg/unroll-7.c                |  2 +-
> >  gcc/testsuite/gcc.misc-tests/help.exp          |  2 +-
> >  .../i386/avx512vpopcntdqvl-vpopcntd-1.c        |  2 +-
> >  gcc/testsuite/gcc.target/i386/pr22141.c        |  2 +-
> >  gcc/testsuite/gcc.target/i386/pr34012.c        |  2 +-
> >  gcc/testsuite/gcc.target/i386/pr49781-1.c      |  2 +-
> >  gcc/testsuite/gcc.target/i386/pr95798-1.c      |  2 +-
> >  gcc/testsuite/gcc.target/i386/pr95798-2.c      |  2 +-
> >  gcc/testsuite/gfortran.dg/pr77498.f            |  2 +-
> >  56 files changed, 74 insertions(+), 60 deletions(-)
> >
> > diff --git a/gcc/common.opt b/gcc/common.opt
> > index b921f5e3b25..4f2c0294c29 100644
> > --- a/gcc/common.opt
> > +++ b/gcc/common.opt
> > @@ -3031,7 +3031,7 @@ Perform variable tracking and also tag variables that are uninitialized.
> >
> >  ; 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/doc/invoke.texi b/gcc/doc/invoke.texi
> > index 78cfc100ac2..be022ef8024 100644
> > --- a/gcc/doc/invoke.texi
> > +++ b/gcc/doc/invoke.texi
> > @@ -10409,9 +10409,13 @@ also turns on the following optimization flags:
> >  -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 @gol
>
> the above is redundant
>
> > +-fvect-cost-model=very-cheap}
> >
> >  Please note the warning under @option{-fgcse} about
> >  invoking @option{-O2} on programs that use computed gotos.
> > @@ -10431,9 +10435,7 @@ by @option{-O2} and also turns on the following optimization flags:
> >  -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
>
> likewise - so just remove it here as you are around
>
> >  -fvect-cost-model=dynamic @gol
> > diff --git a/gcc/opts.c b/gcc/opts.c
> > index 1d2d22d7a3f..cee372a3235 100644
> > --- a/gcc/opts.c
> > +++ b/gcc/opts.c
> > @@ -634,7 +634,8 @@ static const struct default_options default_options_table[] =
> >      { 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,9 @@ static const struct default_options default_options_table[] =
> >      { 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 +667,7 @@ static const struct default_options default_options_table[] =
> >      { 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 },
> > @@ -1331,6 +1333,16 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
> >        = (opts->x_flag_unroll_loops
> >           || opts->x_flag_peel_loops
> >           || opts->x_optimize >= 3);
> > +
> > +  /* 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);
> > +
> > +
>
> please avoid adding excessive vertical space at the end of the function
>
> >  }
> >
> >  #define LEFT_COLUMN  27
> > diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > index 1d79930cd58..9351f7e7a1a 100644
> > --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> > @@ -1,7 +1,7 @@
> >  /* PR middle-end/91458 - inconsistent warning for writing past the end
> >     of an array member
> >     { dg-do compile }
> > -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
> > +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
>
> The testcase is large - what part requires this change?  Given the
> testcase was added for inconsistent warnings do they now become
> inconsistent again as we enable vectorization at -O2?
>
> That said, the testcase adjustments need some explaining - I suppose
> you didn't just slap -fno-tree-vectorize to all of those changing
> behavior?
>
void ga1_ (void)
{
  a1_.a[0] = 0;
  a1_.a[1] = 1;                 // { dg-warning "\\\[-Wstringop-overflow" }
  a1_.a[2] = 2;                 // { dg-warning "\\\[-Wstringop-overflow" }

  struct A1 a;
  a.a[0] = 0;
  a.a[1] = 1;                   // { dg-warning "\\\[-Wstringop-overflow" }
  a.a[2] = 2;                   // { dg-warning "\\\[-Wstringop-overflow" }
  sink (&a);
}

It's supposed to be 2 warning for a.a[1] = 1 and a.a[2] = 1 since
there are 2 accesses, but after enabling vectorization, there's only
one access, so one warning is missing which causes the failure.

   <bb 2> [local count: 1073741824]:
  a1__.a[0] = 0;
  a1__.a[1] = 1;
  a1__.a[2] = 2;
  MEM <char[1]> [(struct A1 *)&a + 1B] = {};
  a.n = 1;
  MEM <vector(2) char> [(char *)&a + 2B] = { 1, 2 };
  sink (&a);
  a ={v} {CLOBBER};
  return;


> Thanks,
> Richard.
>
> >  void sink (void*);
> >
> > diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
> > index 39e32fd4bc9..bc14309480c 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 49ee878806a..60e8dd4f0e2 100644
> > --- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> > +++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> > @@ -1,6 +1,6 @@
> >  /* PR c/98597 - ICE in -Wuninitialized printing a MEM_REF
> >     { dg-do compile }
> > -   { dg-options "-O2 -Wall" } */
> > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> >
> >  struct shared_count {
> >    shared_count () { }
> > diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-51.c b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > index 6028b11637c..8b81a0ccfa7 100644
> > --- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > +++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> > @@ -1,7 +1,7 @@
> >  /* PR middle-end/92333 - missing variable name referencing VLA in warnings
> >     PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
> >     { dg-do compile }
> > -   { dg-options "-O2 -Wall" } */
> > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> >
> >  void sink (void*);
> >
> > diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-3.c b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > index cbf3e9339f5..fbef715aa99 100644
> > --- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > +++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> > @@ -59,7 +59,7 @@ void fas1 (int[static 2]);    // { dg-warning "\\\[-Warray-parameter=" }
> >
> >  /* Also verify that -Warray-bounds doesn't trigger for ordinary array
> >     parameters...  */
> > -#pragma GCC optimize "2"
> > +#pragma GCC optimize ("2,-fno-tree-vectorize")
> >
> >  __attribute__ ((noipa)) void
> >  gca3 (char a[3])
> > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > index bd513151cea..a78242bf26e 100644
> > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> > @@ -3,7 +3,7 @@
> >     PR middle-end/89911 - ICE on a call with no arguments to strnlen
> >     declared with no prototype
> >     { dg-do compile }
> > -   { dg-options "-O2 -Wall" } */
> > +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
> >
> >  typedef __SIZE_TYPE__ size_t;
> >
> > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > index d6201b068b6..808bf87c386 100644
> > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> > @@ -2,7 +2,7 @@
> >     types than char are diagnosed.
> >     { dg-do compile }
> >     { dg-require-effective-target int32plus }
> > -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> > +   { dg-options "-O2 -fno-tree-vectorize -Wall -Wno-array-bounds" } */
> >
> >  typedef __INT16_TYPE__  int16_t;
> >  typedef __INT32_TYPE__  int32_t;
> > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > index 3a27460220c..f418a17ca93 100644
> > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> > @@ -1,7 +1,7 @@
> >  /* PR middle-end/92312 - bogus -Wstringop-overflow storing into a trailing
> >     array backed by larger buffer
> >     { dg-do compile }
> > -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> > +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-tree-vectorize" } */
> >
> >  struct S0 { char a, b[0]; };
> >
> > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > index 6bcba274541..7cc1012130c 100644
> > --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> > @@ -2,7 +2,7 @@
> >     a larger scalar into a smaller array
> >     Verify overflow by aggregate stores.
> >     { dg-do compile }
> > -   { dg-options "-O2" } */
> > +   { dg-options "-O2 -fno-tree-vectorize" } */
> >
> >  #define A(N) (A ## N)
> >  #define Ac1 (AC1){ 0 }
> > diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
> > index e110880bd8e..2e562618489 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 a4af7ec4a8a..da1ab487385 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 85acb980f10..f4912127b81 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 86fee858673..c75060c07ae 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 527b6e5c415..61289d312c2 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 db2ffdfeca4..b59d75b2318 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 3442f91af02..b886f1cce76 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 bb84f2b21a3..123e1919cec 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 4cc43dfd9e1..91ca925be0e 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 2ec2394afb9..60ed5cd8bf9 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_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
> > index acd7de571f8..13fcca4aa11 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 9545dcce3de..cd83f1c0fe5 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 0841bb4deee..0a2bbc4bfde 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 744fe60e8e0..5291bb9e986 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 cf182190e91..96611b5e57b 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 2d6cffc4694..fadb7fff993 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 694d560a621..baf94efe733 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 6e7c72510ff..b0cb0da78e0 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 c744ece6407..dbe000a463e 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 e710a544ff0..d719e0a2257 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 e049e0c30e0..2ba1ee05700 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 70659c00c0e..6c803908781 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 50d86a00485..b9e40e964c1 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 9f9c61aa213..860cde12c0f 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 f216e83c7b3..c7ef73ad59e 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 7d6a724e4ad..0ddad573129 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 f68be2b3379..8c3d9a4fc58 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 ec08d6c0318..1fc8f089345 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 467903bf3fc..46f0d0c2317 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 12f09016943..3fa71685ace 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 cbd6a80d345..00f41c3e4f4 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 da4847320b1..e8848c30acc 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 92b2df80ec8..2e7b5b496ea 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 718b7466e50..7bb8d060631 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 c015191ca32..8708079d397 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 055369bf8b1..695af5757cc 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 5e034d26947..eb6d8686c6a 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=target,optimizers" "" "" ""
> >  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 709cd21e671..a732bc466db 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/pr22141.c b/gcc/testsuite/gcc.target/i386/pr22141.c
> > index 036422e8ccf..b68b97f3f72 100644
> > --- a/gcc/testsuite/gcc.target/i386/pr22141.c
> > +++ b/gcc/testsuite/gcc.target/i386/pr22141.c
> > @@ -1,6 +1,6 @@
> >  /* PR middle-end/22141 */
> >  /* { dg-do compile } */
> > -/* { dg-options "-Os" } */
> > +/* { dg-options "-Os -fno-tree-vectorize" } */
> >
> >  extern void abort (void);
> >
> > diff --git a/gcc/testsuite/gcc.target/i386/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
> > index d0cffa05290..1c1f0eea52e 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 60f9d50d866..d5a2e32db97 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 9a7e32d6f2f..526f48921fd 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 c670d3780e8..6b5c5a73e96 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 f957b57bb00..a0fc8275a84 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
> >
>
> --
> Richard Biener <rguenther@suse.de>
> SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
> Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)



-- 
BR,
Hongtao

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
  2021-09-16  4:33 liuhongt
@ 2021-09-16  8:22 ` Richard Biener
  2021-09-16  9:03   ` Hongtao Liu
  0 siblings, 1 reply; 39+ messages in thread
From: Richard Biener @ 2021-09-16  8:22 UTC (permalink / raw)
  To: liuhongt
  Cc: gcc-patches, jakub, joseph, richard.sandiford, Tamar.Christina,
	jeffreyalaw, segher, linkw, Premachandra.Mallappa, fweimer,
	wschmidt

On Thu, 16 Sep 2021, liuhongt wrote:

> Ping
> rebased on latest trunk.
> 
> gcc/ChangeLog:
> 
> 	* common.opt (ftree-vectorize): Add Var(flag_tree_vectorize).
> 	* doc/invoke.texi (Options That Control Optimization): Update
> 	documents.
> 	* opts.c (default_options_table): Enable auto-vectorization at
> 	O2 with very-cheap cost model.
> 	(finish_options): Use cheap cost model for
> 	explicit -ftree{,-loop}-vectorize.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* c-c++-common/Wstringop-overflow-2.c: Adjust testcase.
> 	* g++.dg/tree-ssa/pr81408.C: Ditto.
> 	* g++.dg/warn/Wuninitialized-13.C: Ditto.
> 	* gcc.dg/Warray-bounds-51.c: Ditto.
> 	* gcc.dg/Warray-parameter-3.c: Ditto.
> 	* gcc.dg/Wstringop-overflow-13.c: Ditto.
> 	* gcc.dg/Wstringop-overflow-14.c: Ditto.
> 	* gcc.dg/Wstringop-overflow-21.c: Ditto.
> 	* gcc.dg/Wstringop-overflow-68.c: Ditto.
> 	* gcc.dg/gomp/pr46032-2.c: Ditto.
> 	* gcc.dg/gomp/pr46032-3.c: Ditto.
> 	* gcc.dg/gomp/simd-2.c: Ditto.
> 	* gcc.dg/gomp/simd-3.c: Ditto.
> 	* gcc.dg/graphite/fuse-1.c: Ditto.
> 	* gcc.dg/pr67089-6.c: Ditto.
> 	* gcc.dg/pr82929-2.c: Ditto.
> 	* gcc.dg/pr82929.c: Ditto.
> 	* gcc.dg/store_merging_1.c: Ditto.
> 	* gcc.dg/store_merging_11.c: Ditto.
> 	* gcc.dg/store_merging_15.c: Ditto.
> 	* gcc.dg/store_merging_16.c: Ditto.
> 	* gcc.dg/store_merging_19.c: Ditto.
> 	* gcc.dg/store_merging_24.c: Ditto.
> 	* gcc.dg/store_merging_25.c: Ditto.
> 	* gcc.dg/store_merging_28.c: Ditto.
> 	* gcc.dg/store_merging_30.c: Ditto.
> 	* gcc.dg/store_merging_5.c: Ditto.
> 	* gcc.dg/store_merging_7.c: Ditto.
> 	* gcc.dg/store_merging_8.c: Ditto.
> 	* gcc.dg/strlenopt-85.c: Ditto.
> 	* gcc.dg/tree-ssa/dump-6.c: Ditto.
> 	* gcc.dg/tree-ssa/pr19210-1.c: Ditto.
> 	* gcc.dg/tree-ssa/pr47059.c: Ditto.
> 	* gcc.dg/tree-ssa/pr86017.c: Ditto.
> 	* gcc.dg/tree-ssa/pr91482.c: Ditto.
> 	* gcc.dg/tree-ssa/predcom-1.c: Ditto.
> 	* gcc.dg/tree-ssa/predcom-dse-3.c: Ditto.
> 	* gcc.dg/tree-ssa/prefetch-3.c: Ditto.
> 	* gcc.dg/tree-ssa/prefetch-6.c: Ditto.
> 	* gcc.dg/tree-ssa/prefetch-8.c: Ditto.
> 	* gcc.dg/tree-ssa/prefetch-9.c: Ditto.
> 	* gcc.dg/tree-ssa/ssa-dse-18.c: Ditto.
> 	* gcc.dg/tree-ssa/ssa-dse-19.c: Ditto.
> 	* gcc.dg/uninit-40.c: Ditto.
> 	* gcc.dg/unroll-7.c: Ditto.
> 	* gcc.misc-tests/help.exp: Ditto.
> 	* gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
> 	* gcc.target/i386/pr22141.c: Ditto.
> 	* gcc.target/i386/pr34012.c: Ditto.
> 	* gcc.target/i386/pr49781-1.c: Ditto.
> 	* gcc.target/i386/pr95798-1.c: Ditto.
> 	* gcc.target/i386/pr95798-2.c: Ditto.
> 	* gfortran.dg/pr77498.f: Ditto.
> ---
>  gcc/common.opt                                 |  2 +-
>  gcc/doc/invoke.texi                            |  8 +++++---
>  gcc/opts.c                                     | 18 +++++++++++++++---
>  .../c-c++-common/Wstringop-overflow-2.c        |  2 +-
>  gcc/testsuite/g++.dg/tree-ssa/pr81408.C        |  2 +-
>  gcc/testsuite/g++.dg/warn/Wuninitialized-13.C  |  2 +-
>  gcc/testsuite/gcc.dg/Warray-bounds-51.c        |  2 +-
>  gcc/testsuite/gcc.dg/Warray-parameter-3.c      |  2 +-
>  gcc/testsuite/gcc.dg/Wstringop-overflow-13.c   |  2 +-
>  gcc/testsuite/gcc.dg/Wstringop-overflow-14.c   |  2 +-
>  gcc/testsuite/gcc.dg/Wstringop-overflow-21.c   |  2 +-
>  gcc/testsuite/gcc.dg/Wstringop-overflow-68.c   |  2 +-
>  gcc/testsuite/gcc.dg/gomp/pr46032-2.c          |  2 +-
>  gcc/testsuite/gcc.dg/gomp/pr46032-3.c          |  2 +-
>  gcc/testsuite/gcc.dg/gomp/simd-2.c             |  2 +-
>  gcc/testsuite/gcc.dg/gomp/simd-3.c             |  2 +-
>  gcc/testsuite/gcc.dg/graphite/fuse-1.c         |  2 +-
>  gcc/testsuite/gcc.dg/pr67089-6.c               |  2 +-
>  gcc/testsuite/gcc.dg/pr82929-2.c               |  2 +-
>  gcc/testsuite/gcc.dg/pr82929.c                 |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_1.c         |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_11.c        |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_15.c        |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_16.c        |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_19.c        |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_24.c        |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_25.c        |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_28.c        |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_30.c        |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_5.c         |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_7.c         |  2 +-
>  gcc/testsuite/gcc.dg/store_merging_8.c         |  2 +-
>  gcc/testsuite/gcc.dg/strlenopt-85.c            |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/dump-6.c         |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c      |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/pr47059.c        |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/pr86017.c        |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/pr91482.c        |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c      |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c  |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c     |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c     |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c     |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c     |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c     |  2 +-
>  gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c     |  2 +-
>  gcc/testsuite/gcc.dg/uninit-40.c               |  2 +-
>  gcc/testsuite/gcc.dg/unroll-7.c                |  2 +-
>  gcc/testsuite/gcc.misc-tests/help.exp          |  2 +-
>  .../i386/avx512vpopcntdqvl-vpopcntd-1.c        |  2 +-
>  gcc/testsuite/gcc.target/i386/pr22141.c        |  2 +-
>  gcc/testsuite/gcc.target/i386/pr34012.c        |  2 +-
>  gcc/testsuite/gcc.target/i386/pr49781-1.c      |  2 +-
>  gcc/testsuite/gcc.target/i386/pr95798-1.c      |  2 +-
>  gcc/testsuite/gcc.target/i386/pr95798-2.c      |  2 +-
>  gcc/testsuite/gfortran.dg/pr77498.f            |  2 +-
>  56 files changed, 74 insertions(+), 60 deletions(-)
> 
> diff --git a/gcc/common.opt b/gcc/common.opt
> index b921f5e3b25..4f2c0294c29 100644
> --- a/gcc/common.opt
> +++ b/gcc/common.opt
> @@ -3031,7 +3031,7 @@ Perform variable tracking and also tag variables that are uninitialized.
>  
>  ; 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/doc/invoke.texi b/gcc/doc/invoke.texi
> index 78cfc100ac2..be022ef8024 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -10409,9 +10409,13 @@ also turns on the following optimization flags:
>  -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 @gol

the above is redundant

> +-fvect-cost-model=very-cheap}
>  
>  Please note the warning under @option{-fgcse} about
>  invoking @option{-O2} on programs that use computed gotos.
> @@ -10431,9 +10435,7 @@ by @option{-O2} and also turns on the following optimization flags:
>  -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

likewise - so just remove it here as you are around

>  -fvect-cost-model=dynamic @gol
> diff --git a/gcc/opts.c b/gcc/opts.c
> index 1d2d22d7a3f..cee372a3235 100644
> --- a/gcc/opts.c
> +++ b/gcc/opts.c
> @@ -634,7 +634,8 @@ static const struct default_options default_options_table[] =
>      { 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,9 @@ static const struct default_options default_options_table[] =
>      { 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 +667,7 @@ static const struct default_options default_options_table[] =
>      { 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 },
> @@ -1331,6 +1333,16 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
>        = (opts->x_flag_unroll_loops
>           || opts->x_flag_peel_loops
>           || opts->x_optimize >= 3);
> +
> +  /* 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);
> +
> +

please avoid adding excessive vertical space at the end of the function

>  }
>  
>  #define LEFT_COLUMN	27
> diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> index 1d79930cd58..9351f7e7a1a 100644
> --- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> +++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
> @@ -1,7 +1,7 @@
>  /* PR middle-end/91458 - inconsistent warning for writing past the end
>     of an array member
>     { dg-do compile }
> -   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */

The testcase is large - what part requires this change?  Given the
testcase was added for inconsistent warnings do they now become
inconsistent again as we enable vectorization at -O2?

That said, the testcase adjustments need some explaining - I suppose
you didn't just slap -fno-tree-vectorize to all of those changing
behavior?

Thanks,
Richard.

>  void sink (void*);
>  
> diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
> index 39e32fd4bc9..bc14309480c 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 49ee878806a..60e8dd4f0e2 100644
> --- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> +++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
> @@ -1,6 +1,6 @@
>  /* PR c/98597 - ICE in -Wuninitialized printing a MEM_REF
>     { dg-do compile }
> -   { dg-options "-O2 -Wall" } */
> +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
>  
>  struct shared_count {
>    shared_count () { }
> diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-51.c b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> index 6028b11637c..8b81a0ccfa7 100644
> --- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> +++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
> @@ -1,7 +1,7 @@
>  /* PR middle-end/92333 - missing variable name referencing VLA in warnings
>     PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
>     { dg-do compile }
> -   { dg-options "-O2 -Wall" } */
> +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
>  
>  void sink (void*);
>  
> diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-3.c b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> index cbf3e9339f5..fbef715aa99 100644
> --- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> +++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
> @@ -59,7 +59,7 @@ void fas1 (int[static 2]);    // { dg-warning "\\\[-Warray-parameter=" }
>  
>  /* Also verify that -Warray-bounds doesn't trigger for ordinary array
>     parameters...  */
> -#pragma GCC optimize "2"
> +#pragma GCC optimize ("2,-fno-tree-vectorize")
>  
>  __attribute__ ((noipa)) void
>  gca3 (char a[3])
> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> index bd513151cea..a78242bf26e 100644
> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
> @@ -3,7 +3,7 @@
>     PR middle-end/89911 - ICE on a call with no arguments to strnlen
>     declared with no prototype
>     { dg-do compile }
> -   { dg-options "-O2 -Wall" } */
> +   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
>  
>  typedef __SIZE_TYPE__ size_t;
>  
> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> index d6201b068b6..808bf87c386 100644
> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
> @@ -2,7 +2,7 @@
>     types than char are diagnosed.
>     { dg-do compile }
>     { dg-require-effective-target int32plus }
> -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> +   { dg-options "-O2 -fno-tree-vectorize -Wall -Wno-array-bounds" } */
>  
>  typedef __INT16_TYPE__  int16_t;
>  typedef __INT32_TYPE__  int32_t;
> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> index 3a27460220c..f418a17ca93 100644
> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
> @@ -1,7 +1,7 @@
>  /* PR middle-end/92312 - bogus -Wstringop-overflow storing into a trailing
>     array backed by larger buffer
>     { dg-do compile }
> -   { dg-options "-O2 -Wall -Wno-array-bounds" } */
> +   { dg-options "-O2 -Wall -Wno-array-bounds -fno-tree-vectorize" } */
>  
>  struct S0 { char a, b[0]; };
>  
> diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> index 6bcba274541..7cc1012130c 100644
> --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
> @@ -2,7 +2,7 @@
>     a larger scalar into a smaller array
>     Verify overflow by aggregate stores.
>     { dg-do compile }
> -   { dg-options "-O2" } */
> +   { dg-options "-O2 -fno-tree-vectorize" } */
>  
>  #define A(N) (A ## N)
>  #define Ac1 (AC1){ 0 }
> diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
> index e110880bd8e..2e562618489 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 a4af7ec4a8a..da1ab487385 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 85acb980f10..f4912127b81 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 86fee858673..c75060c07ae 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 527b6e5c415..61289d312c2 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 db2ffdfeca4..b59d75b2318 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 3442f91af02..b886f1cce76 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 bb84f2b21a3..123e1919cec 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 4cc43dfd9e1..91ca925be0e 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 2ec2394afb9..60ed5cd8bf9 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_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
> index acd7de571f8..13fcca4aa11 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 9545dcce3de..cd83f1c0fe5 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 0841bb4deee..0a2bbc4bfde 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 744fe60e8e0..5291bb9e986 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 cf182190e91..96611b5e57b 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 2d6cffc4694..fadb7fff993 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 694d560a621..baf94efe733 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 6e7c72510ff..b0cb0da78e0 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 c744ece6407..dbe000a463e 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 e710a544ff0..d719e0a2257 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 e049e0c30e0..2ba1ee05700 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 70659c00c0e..6c803908781 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 50d86a00485..b9e40e964c1 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 9f9c61aa213..860cde12c0f 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 f216e83c7b3..c7ef73ad59e 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 7d6a724e4ad..0ddad573129 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 f68be2b3379..8c3d9a4fc58 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 ec08d6c0318..1fc8f089345 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 467903bf3fc..46f0d0c2317 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 12f09016943..3fa71685ace 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 cbd6a80d345..00f41c3e4f4 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 da4847320b1..e8848c30acc 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 92b2df80ec8..2e7b5b496ea 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 718b7466e50..7bb8d060631 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 c015191ca32..8708079d397 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 055369bf8b1..695af5757cc 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 5e034d26947..eb6d8686c6a 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=target,optimizers" "" "" ""
>  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 709cd21e671..a732bc466db 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/pr22141.c b/gcc/testsuite/gcc.target/i386/pr22141.c
> index 036422e8ccf..b68b97f3f72 100644
> --- a/gcc/testsuite/gcc.target/i386/pr22141.c
> +++ b/gcc/testsuite/gcc.target/i386/pr22141.c
> @@ -1,6 +1,6 @@
>  /* PR middle-end/22141 */
>  /* { dg-do compile } */
> -/* { dg-options "-Os" } */
> +/* { dg-options "-Os -fno-tree-vectorize" } */
>  
>  extern void abort (void);
>  
> diff --git a/gcc/testsuite/gcc.target/i386/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
> index d0cffa05290..1c1f0eea52e 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 60f9d50d866..d5a2e32db97 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 9a7e32d6f2f..526f48921fd 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 c670d3780e8..6b5c5a73e96 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 f957b57bb00..a0fc8275a84 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
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.
@ 2021-09-16  4:33 liuhongt
  2021-09-16  8:22 ` Richard Biener
  0 siblings, 1 reply; 39+ messages in thread
From: liuhongt @ 2021-09-16  4:33 UTC (permalink / raw)
  To: gcc-patches
  Cc: jakub, joseph, rguenther, richard.sandiford, Tamar.Christina,
	jeffreyalaw, segher, linkw, Premachandra.Mallappa, fweimer,
	wschmidt

Ping
rebased on latest trunk.

gcc/ChangeLog:

	* common.opt (ftree-vectorize): Add Var(flag_tree_vectorize).
	* doc/invoke.texi (Options That Control Optimization): Update
	documents.
	* opts.c (default_options_table): Enable auto-vectorization at
	O2 with very-cheap cost model.
	(finish_options): Use cheap cost model for
	explicit -ftree{,-loop}-vectorize.

gcc/testsuite/ChangeLog:

	* c-c++-common/Wstringop-overflow-2.c: Adjust testcase.
	* g++.dg/tree-ssa/pr81408.C: Ditto.
	* g++.dg/warn/Wuninitialized-13.C: Ditto.
	* gcc.dg/Warray-bounds-51.c: Ditto.
	* gcc.dg/Warray-parameter-3.c: Ditto.
	* gcc.dg/Wstringop-overflow-13.c: Ditto.
	* gcc.dg/Wstringop-overflow-14.c: Ditto.
	* gcc.dg/Wstringop-overflow-21.c: Ditto.
	* gcc.dg/Wstringop-overflow-68.c: Ditto.
	* gcc.dg/gomp/pr46032-2.c: Ditto.
	* gcc.dg/gomp/pr46032-3.c: Ditto.
	* gcc.dg/gomp/simd-2.c: Ditto.
	* gcc.dg/gomp/simd-3.c: Ditto.
	* gcc.dg/graphite/fuse-1.c: Ditto.
	* gcc.dg/pr67089-6.c: Ditto.
	* gcc.dg/pr82929-2.c: Ditto.
	* gcc.dg/pr82929.c: Ditto.
	* gcc.dg/store_merging_1.c: Ditto.
	* gcc.dg/store_merging_11.c: Ditto.
	* gcc.dg/store_merging_15.c: Ditto.
	* gcc.dg/store_merging_16.c: Ditto.
	* gcc.dg/store_merging_19.c: Ditto.
	* gcc.dg/store_merging_24.c: Ditto.
	* gcc.dg/store_merging_25.c: Ditto.
	* gcc.dg/store_merging_28.c: Ditto.
	* gcc.dg/store_merging_30.c: Ditto.
	* gcc.dg/store_merging_5.c: Ditto.
	* gcc.dg/store_merging_7.c: Ditto.
	* gcc.dg/store_merging_8.c: Ditto.
	* gcc.dg/strlenopt-85.c: Ditto.
	* gcc.dg/tree-ssa/dump-6.c: Ditto.
	* gcc.dg/tree-ssa/pr19210-1.c: Ditto.
	* gcc.dg/tree-ssa/pr47059.c: Ditto.
	* gcc.dg/tree-ssa/pr86017.c: Ditto.
	* gcc.dg/tree-ssa/pr91482.c: Ditto.
	* gcc.dg/tree-ssa/predcom-1.c: Ditto.
	* gcc.dg/tree-ssa/predcom-dse-3.c: Ditto.
	* gcc.dg/tree-ssa/prefetch-3.c: Ditto.
	* gcc.dg/tree-ssa/prefetch-6.c: Ditto.
	* gcc.dg/tree-ssa/prefetch-8.c: Ditto.
	* gcc.dg/tree-ssa/prefetch-9.c: Ditto.
	* gcc.dg/tree-ssa/ssa-dse-18.c: Ditto.
	* gcc.dg/tree-ssa/ssa-dse-19.c: Ditto.
	* gcc.dg/uninit-40.c: Ditto.
	* gcc.dg/unroll-7.c: Ditto.
	* gcc.misc-tests/help.exp: Ditto.
	* gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
	* gcc.target/i386/pr22141.c: Ditto.
	* gcc.target/i386/pr34012.c: Ditto.
	* gcc.target/i386/pr49781-1.c: Ditto.
	* gcc.target/i386/pr95798-1.c: Ditto.
	* gcc.target/i386/pr95798-2.c: Ditto.
	* gfortran.dg/pr77498.f: Ditto.
---
 gcc/common.opt                                 |  2 +-
 gcc/doc/invoke.texi                            |  8 +++++---
 gcc/opts.c                                     | 18 +++++++++++++++---
 .../c-c++-common/Wstringop-overflow-2.c        |  2 +-
 gcc/testsuite/g++.dg/tree-ssa/pr81408.C        |  2 +-
 gcc/testsuite/g++.dg/warn/Wuninitialized-13.C  |  2 +-
 gcc/testsuite/gcc.dg/Warray-bounds-51.c        |  2 +-
 gcc/testsuite/gcc.dg/Warray-parameter-3.c      |  2 +-
 gcc/testsuite/gcc.dg/Wstringop-overflow-13.c   |  2 +-
 gcc/testsuite/gcc.dg/Wstringop-overflow-14.c   |  2 +-
 gcc/testsuite/gcc.dg/Wstringop-overflow-21.c   |  2 +-
 gcc/testsuite/gcc.dg/Wstringop-overflow-68.c   |  2 +-
 gcc/testsuite/gcc.dg/gomp/pr46032-2.c          |  2 +-
 gcc/testsuite/gcc.dg/gomp/pr46032-3.c          |  2 +-
 gcc/testsuite/gcc.dg/gomp/simd-2.c             |  2 +-
 gcc/testsuite/gcc.dg/gomp/simd-3.c             |  2 +-
 gcc/testsuite/gcc.dg/graphite/fuse-1.c         |  2 +-
 gcc/testsuite/gcc.dg/pr67089-6.c               |  2 +-
 gcc/testsuite/gcc.dg/pr82929-2.c               |  2 +-
 gcc/testsuite/gcc.dg/pr82929.c                 |  2 +-
 gcc/testsuite/gcc.dg/store_merging_1.c         |  2 +-
 gcc/testsuite/gcc.dg/store_merging_11.c        |  2 +-
 gcc/testsuite/gcc.dg/store_merging_15.c        |  2 +-
 gcc/testsuite/gcc.dg/store_merging_16.c        |  2 +-
 gcc/testsuite/gcc.dg/store_merging_19.c        |  2 +-
 gcc/testsuite/gcc.dg/store_merging_24.c        |  2 +-
 gcc/testsuite/gcc.dg/store_merging_25.c        |  2 +-
 gcc/testsuite/gcc.dg/store_merging_28.c        |  2 +-
 gcc/testsuite/gcc.dg/store_merging_30.c        |  2 +-
 gcc/testsuite/gcc.dg/store_merging_5.c         |  2 +-
 gcc/testsuite/gcc.dg/store_merging_7.c         |  2 +-
 gcc/testsuite/gcc.dg/store_merging_8.c         |  2 +-
 gcc/testsuite/gcc.dg/strlenopt-85.c            |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/dump-6.c         |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c      |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr47059.c        |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr86017.c        |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr91482.c        |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c      |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c  |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c     |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c     |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c     |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c     |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c     |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c     |  2 +-
 gcc/testsuite/gcc.dg/uninit-40.c               |  2 +-
 gcc/testsuite/gcc.dg/unroll-7.c                |  2 +-
 gcc/testsuite/gcc.misc-tests/help.exp          |  2 +-
 .../i386/avx512vpopcntdqvl-vpopcntd-1.c        |  2 +-
 gcc/testsuite/gcc.target/i386/pr22141.c        |  2 +-
 gcc/testsuite/gcc.target/i386/pr34012.c        |  2 +-
 gcc/testsuite/gcc.target/i386/pr49781-1.c      |  2 +-
 gcc/testsuite/gcc.target/i386/pr95798-1.c      |  2 +-
 gcc/testsuite/gcc.target/i386/pr95798-2.c      |  2 +-
 gcc/testsuite/gfortran.dg/pr77498.f            |  2 +-
 56 files changed, 74 insertions(+), 60 deletions(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index b921f5e3b25..4f2c0294c29 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -3031,7 +3031,7 @@ Perform variable tracking and also tag variables that are uninitialized.
 
 ; 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/doc/invoke.texi b/gcc/doc/invoke.texi
index 78cfc100ac2..be022ef8024 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10409,9 +10409,13 @@ also turns on the following optimization flags:
 -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 @gol
+-fvect-cost-model=very-cheap}
 
 Please note the warning under @option{-fgcse} about
 invoking @option{-O2} on programs that use computed gotos.
@@ -10431,9 +10435,7 @@ by @option{-O2} and also turns on the following optimization flags:
 -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
diff --git a/gcc/opts.c b/gcc/opts.c
index 1d2d22d7a3f..cee372a3235 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -634,7 +634,8 @@ static const struct default_options default_options_table[] =
     { 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,9 @@ static const struct default_options default_options_table[] =
     { 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 +667,7 @@ static const struct default_options default_options_table[] =
     { 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 },
@@ -1331,6 +1333,16 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
       = (opts->x_flag_unroll_loops
          || opts->x_flag_peel_loops
          || opts->x_optimize >= 3);
+
+  /* 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/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
index 1d79930cd58..9351f7e7a1a 100644
--- a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
+++ b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c
@@ -1,7 +1,7 @@
 /* PR middle-end/91458 - inconsistent warning for writing past the end
    of an array member
    { dg-do compile }
-   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf" } */
+   { dg-options "-O2 -Wall -Wno-array-bounds -fno-ipa-icf -fno-tree-vectorize" } */
 
 void sink (void*);
 
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
index 39e32fd4bc9..bc14309480c 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 49ee878806a..60e8dd4f0e2 100644
--- a/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
+++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-13.C
@@ -1,6 +1,6 @@
 /* PR c/98597 - ICE in -Wuninitialized printing a MEM_REF
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
 
 struct shared_count {
   shared_count () { }
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-51.c b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
index 6028b11637c..8b81a0ccfa7 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-51.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-51.c
@@ -1,7 +1,7 @@
 /* PR middle-end/92333 - missing variable name referencing VLA in warnings
    PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
 
 void sink (void*);
 
diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-3.c b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
index cbf3e9339f5..fbef715aa99 100644
--- a/gcc/testsuite/gcc.dg/Warray-parameter-3.c
+++ b/gcc/testsuite/gcc.dg/Warray-parameter-3.c
@@ -59,7 +59,7 @@ void fas1 (int[static 2]);    // { dg-warning "\\\[-Warray-parameter=" }
 
 /* Also verify that -Warray-bounds doesn't trigger for ordinary array
    parameters...  */
-#pragma GCC optimize "2"
+#pragma GCC optimize ("2,-fno-tree-vectorize")
 
 __attribute__ ((noipa)) void
 gca3 (char a[3])
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
index bd513151cea..a78242bf26e 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
@@ -3,7 +3,7 @@
    PR middle-end/89911 - ICE on a call with no arguments to strnlen
    declared with no prototype
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall -fno-tree-vectorize" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
index d6201b068b6..808bf87c386 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
@@ -2,7 +2,7 @@
    types than char are diagnosed.
    { dg-do compile }
    { dg-require-effective-target int32plus }
-   { dg-options "-O2 -Wall -Wno-array-bounds" } */
+   { dg-options "-O2 -fno-tree-vectorize -Wall -Wno-array-bounds" } */
 
 typedef __INT16_TYPE__  int16_t;
 typedef __INT32_TYPE__  int32_t;
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
index 3a27460220c..f418a17ca93 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-21.c
@@ -1,7 +1,7 @@
 /* PR middle-end/92312 - bogus -Wstringop-overflow storing into a trailing
    array backed by larger buffer
    { dg-do compile }
-   { dg-options "-O2 -Wall -Wno-array-bounds" } */
+   { dg-options "-O2 -Wall -Wno-array-bounds -fno-tree-vectorize" } */
 
 struct S0 { char a, b[0]; };
 
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
index 6bcba274541..7cc1012130c 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
@@ -2,7 +2,7 @@
    a larger scalar into a smaller array
    Verify overflow by aggregate stores.
    { dg-do compile }
-   { dg-options "-O2" } */
+   { dg-options "-O2 -fno-tree-vectorize" } */
 
 #define A(N) (A ## N)
 #define Ac1 (AC1){ 0 }
diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c
index e110880bd8e..2e562618489 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 a4af7ec4a8a..da1ab487385 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 85acb980f10..f4912127b81 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 86fee858673..c75060c07ae 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 527b6e5c415..61289d312c2 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 db2ffdfeca4..b59d75b2318 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 3442f91af02..b886f1cce76 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 bb84f2b21a3..123e1919cec 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 4cc43dfd9e1..91ca925be0e 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 2ec2394afb9..60ed5cd8bf9 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_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c
index acd7de571f8..13fcca4aa11 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 9545dcce3de..cd83f1c0fe5 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 0841bb4deee..0a2bbc4bfde 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 744fe60e8e0..5291bb9e986 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 cf182190e91..96611b5e57b 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 2d6cffc4694..fadb7fff993 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 694d560a621..baf94efe733 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 6e7c72510ff..b0cb0da78e0 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 c744ece6407..dbe000a463e 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 e710a544ff0..d719e0a2257 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 e049e0c30e0..2ba1ee05700 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 70659c00c0e..6c803908781 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 50d86a00485..b9e40e964c1 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 9f9c61aa213..860cde12c0f 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 f216e83c7b3..c7ef73ad59e 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 7d6a724e4ad..0ddad573129 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 f68be2b3379..8c3d9a4fc58 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 ec08d6c0318..1fc8f089345 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 467903bf3fc..46f0d0c2317 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 12f09016943..3fa71685ace 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 cbd6a80d345..00f41c3e4f4 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 da4847320b1..e8848c30acc 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 92b2df80ec8..2e7b5b496ea 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 718b7466e50..7bb8d060631 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 c015191ca32..8708079d397 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 055369bf8b1..695af5757cc 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 5e034d26947..eb6d8686c6a 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=target,optimizers" "" "" ""
 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 709cd21e671..a732bc466db 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/pr22141.c b/gcc/testsuite/gcc.target/i386/pr22141.c
index 036422e8ccf..b68b97f3f72 100644
--- a/gcc/testsuite/gcc.target/i386/pr22141.c
+++ b/gcc/testsuite/gcc.target/i386/pr22141.c
@@ -1,6 +1,6 @@
 /* PR middle-end/22141 */
 /* { dg-do compile } */
-/* { dg-options "-Os" } */
+/* { dg-options "-Os -fno-tree-vectorize" } */
 
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.target/i386/pr34012.c b/gcc/testsuite/gcc.target/i386/pr34012.c
index d0cffa05290..1c1f0eea52e 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 60f9d50d866..d5a2e32db97 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 9a7e32d6f2f..526f48921fd 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 c670d3780e8..6b5c5a73e96 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 f957b57bb00..a0fc8275a84 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
-- 
2.27.0


^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2021-10-08 23:43 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06  8:46 [PATCH] Enable auto-vectorization at O2 with very-cheap cost model liuhongt
2021-09-06  8:55 ` Hongtao Liu
2021-09-06  9:18 ` Richard Biener
2021-09-06  9:41   ` Jakub Jelinek
2021-09-06 10:58     ` Hongtao Liu
2021-09-06 11:01       ` Jakub Jelinek
2021-09-06 11:15         ` Hongtao Liu
2021-09-06 11:15           ` Jakub Jelinek
2021-09-06 12:18             ` Richard Biener
2021-09-06 12:30               ` Jakub Jelinek
2021-09-06 12:43                 ` Richard Biener
2021-09-06 11:05     ` Richard Biener
2021-09-06  9:41   ` Hongtao Liu
2021-09-06 16:37 ` Joseph Myers
2021-09-07  2:07   ` Hongtao Liu
2021-09-16  4:33 liuhongt
2021-09-16  8:22 ` Richard Biener
2021-09-16  9:03   ` Hongtao Liu
2021-09-16 12:31     ` Richard Biener
2021-09-17  3:26       ` Hongtao Liu
2021-09-17  7:47         ` Richard Biener
2021-09-17  8:06           ` Hongtao Liu
2021-09-19 20:13     ` Martin Sebor
2021-09-22  1:38       ` Hongtao Liu
2021-09-22 14:21         ` Martin Sebor
2021-09-22 15:03           ` Martin Sebor
2021-09-23  1:48           ` Hongtao Liu
2021-09-23  2:08             ` Hongtao Liu
2021-09-23  6:30               ` Richard Biener
2021-09-23 15:18                 ` Martin Sebor
2021-09-24  3:32                   ` Hongtao Liu
2021-09-24 14:27                     ` Martin Sebor
2021-09-26  3:18                       ` liuhongt
2021-09-28 11:18                         ` Richard Biener
2021-10-07 15:34                         ` Martin Liška
2021-10-07 15:36                           ` H.J. Lu
2021-10-08  2:16                             ` Hongtao Liu
2021-10-08 10:49                 ` Aldy Hernandez
2021-10-08 23:43                   ` Martin Sebor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).