Index: gcc/doc/sourcebuild.texi
===================================================================
--- gcc/doc/sourcebuild.texi	2017-11-03 16:06:52.929591350 +0000
+++ gcc/doc/sourcebuild.texi	2017-11-03 16:06:56.516976666 +0000
@@ -1373,6 +1373,10 @@ Target supports Fortran @code{real} kind
 @subsubsection Vector-specific attributes
 
 @table @code
+@item vect_align_stack_vars
+The target's ABI allows stack variables to be aligned to the preferred
+vector alignment.
+
 @item vect_condition
 Target supports vector conditional operations.
 
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	2017-11-03 16:06:52.930591737 +0000
+++ gcc/testsuite/lib/target-supports.exp	2017-11-03 16:06:56.519977825 +0000
@@ -6350,6 +6350,12 @@ proc check_effective_target_vect_element
     return [check_effective_target_vect_variable_length]
 }
 
+# Return 1 if we can align stack data to the preferred vector alignment.
+
+proc check_effective_target_vect_align_stack_vars { } {
+    return 1
+}
+
 # Return 1 if vector alignment (for types of size 32 bit or less) is reachable, 0 otherwise.
 
 proc check_effective_target_vector_alignment_reachable { } {
Index: gcc/testsuite/gcc.dg/vect/vect-23.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-23.c	2016-11-22 21:16:10.000000000 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-23.c	2017-11-03 16:06:56.516976666 +0000
@@ -125,4 +125,4 @@ int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-24.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-24.c	2017-02-23 19:54:09.000000000 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-24.c	2017-11-03 16:06:56.516976666 +0000
@@ -123,4 +123,4 @@ int main (void)
   return main1 ();
 }
 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail { { ! aarch64*-*-* } && { ! arm-*-* } } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-25.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-25.c	2015-06-02 23:53:35.000000000 +0100
+++ gcc/testsuite/gcc.dg/vect/vect-25.c	2017-11-03 16:06:56.516976666 +0000
@@ -51,4 +51,4 @@ int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-26.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-26.c	2017-11-03 16:06:22.562036677 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-26.c	2017-11-03 16:06:56.516976666 +0000
@@ -36,5 +36,5 @@ int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_element_align_preferred } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_element_align_preferred || { ! vect_align_stack_vars } } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-32-big-array.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-32-big-array.c	2015-06-02 23:53:38.000000000 +0100
+++ gcc/testsuite/gcc.dg/vect/vect-32-big-array.c	2017-11-03 16:06:56.516976666 +0000
@@ -36,4 +36,4 @@ int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-32.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-32.c	2017-11-03 16:06:08.012090077 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-32.c	2017-11-03 16:06:56.516976666 +0000
@@ -40,4 +40,4 @@ int main (void)
 } 
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-40.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-40.c	2015-06-02 23:53:38.000000000 +0100
+++ gcc/testsuite/gcc.dg/vect/vect-40.c	2017-11-03 16:06:56.516976666 +0000
@@ -59,4 +59,4 @@ int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"} } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-42.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-42.c	2017-11-03 16:06:26.237889385 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-42.c	2017-11-03 16:06:56.516976666 +0000
@@ -67,5 +67,5 @@ int main (void)
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { { ! vector_alignment_reachable } && { ! vect_element_align } } } } } */
 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { vect_no_align || { { !  vector_alignment_reachable } || vect_element_align  } } } } }  */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_element_align xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_element_align xfail { ! { vect_unaligned_possible && vect_align_stack_vars } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || { { ! vector_alignment_reachable } || vect_element_align } } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-46.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-46.c	2015-06-02 23:53:38.000000000 +0100
+++ gcc/testsuite/gcc.dg/vect/vect-46.c	2017-11-03 16:06:56.517977052 +0000
@@ -61,4 +61,4 @@ int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-48.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-48.c	2017-11-03 16:06:26.238889073 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-48.c	2017-11-03 16:06:56.517977052 +0000
@@ -55,6 +55,7 @@ int main (void)
    (The store is aligned).  */
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target { ! vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_align_stack_vars xfail { ! vect_unaligned_possible } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-52.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-52.c	2017-11-03 16:06:26.238889073 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-52.c	2017-11-03 16:06:56.517977052 +0000
@@ -56,6 +56,7 @@ int main (void)
    (The store is aligned).  */
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target { ! vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_align_stack_vars xfail { ! vect_unaligned_possible } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-54.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-54.c	2017-11-03 16:06:22.562036677 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-54.c	2017-11-03 16:06:56.517977052 +0000
@@ -60,5 +60,5 @@ int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_element_align_preferred } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-62.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-62.c	2015-11-11 15:40:09.000000000 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-62.c	2017-11-03 16:06:56.517977052 +0000
@@ -65,4 +65,4 @@ int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-67.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-67.c	2017-11-03 16:06:08.013090240 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-67.c	2017-11-03 16:06:56.517977052 +0000
@@ -49,4 +49,4 @@ int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-75-big-array.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-75-big-array.c	2017-11-03 16:06:26.238889073 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-75-big-array.c	2017-11-03 16:06:56.517977052 +0000
@@ -50,4 +50,5 @@ int main (void)
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
 /*  { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { ! vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_align_stack_vars xfail { ! vect_unaligned_possible } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-75.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-75.c	2017-11-03 16:06:26.239888760 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-75.c	2017-11-03 16:06:56.517977052 +0000
@@ -50,4 +50,5 @@ int main (void)
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { ! vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_align_stack_vars xfail { ! vect_unaligned_possible } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c	2017-11-03 16:06:26.239888760 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c	2017-11-03 16:06:56.518977438 +0000
@@ -54,7 +54,8 @@ int main (void)
    both for the load and the store.  */
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { ! vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_align_stack_vars xfail { ! vect_unaligned_possible } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {! vect_no_align} && { unaligned_stack && vector_alignment_reachable } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { {! unaligned_stack} && { vect_no_align && { ! vect_hw_misalign } } } || {unaligned_stack && { {! vector_alignment_reachable} && {! vect_no_align } } } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { { unaligned_stack && { vector_alignment_reachable && vect_no_align } } || {unaligned_stack && { {! vector_alignment_reachable} && vect_no_align } } } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c	2017-11-03 16:06:26.239888760 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c	2017-11-03 16:06:56.518977438 +0000
@@ -55,7 +55,8 @@ int main (void)
    both for the load and the store.  */
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_align_stack_vars xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { ! vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {! vect_no_align} && { unaligned_stack && vector_alignment_reachable } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { {! unaligned_stack} && { vect_no_align && { ! vect_hw_misalign } } } || {unaligned_stack && { {! vector_alignment_reachable} && { ! vect_no_align } } } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { { unaligned_stack && { vector_alignment_reachable && vect_no_align } } || {unaligned_stack && { {! vector_alignment_reachable} && vect_no_align } } } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-89-big-array.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-89-big-array.c	2017-11-03 16:06:22.562036677 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-89-big-array.c	2017-11-03 16:06:56.518977438 +0000
@@ -45,5 +45,5 @@ int main (void)
 }
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_element_align_preferred } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_element_align_preferred || { ! vect_align_stack_vars } } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-89.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-89.c	2017-11-03 16:06:22.562036677 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-89.c	2017-11-03 16:06:56.518977438 +0000
@@ -49,5 +49,5 @@ int main (void)
 } 
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_element_align_preferred } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_element_align_preferred || { ! vect_align_stack_vars } } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-96.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-96.c	2017-11-03 16:06:26.239888760 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-96.c	2017-11-03 16:06:56.518977438 +0000
@@ -48,6 +48,7 @@ int main (void)
    For targets that don't support unaligned loads, version for the store.  */
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_no_align} && vector_alignment_reachable } xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { { {! vect_no_align} && vector_alignment_reachable } && { ! vect_align_stack_vars } } xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { { {! vect_no_align} && vector_alignment_reachable } && vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || { { ! vector_alignment_reachable} || vect_element_align } } } } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { vect_no_align && { ! vect_hw_misalign } } || { {! vector_alignment_reachable} && {! vect_element_align} } } } } } */
Index: gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c	2017-11-03 16:06:26.239888760 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c	2017-11-03 16:06:56.518977438 +0000
@@ -59,5 +59,5 @@ int main (void)
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { ! { vect_unaligned_possible && vect_align_stack_vars } } } } } */
 
Index: gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c	2017-11-03 16:06:26.240888448 +0000
+++ gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c	2017-11-03 16:06:56.518977438 +0000
@@ -66,5 +66,5 @@ int main (void)
 
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { sparc*-*-* && ilp32 } }} } */
 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 6 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" { xfail { ! vect_unaligned_possible } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" { xfail { ! { vect_unaligned_possible && vect_align_stack_vars } } } } } */
 
