Index: testsuite/gcc.dg/vect/vect-17.c =================================================================== *** testsuite/gcc.dg/vect/vect-17.c (revision 128976) --- testsuite/gcc.dg/vect/vect-17.c (working copy) *************** int main (void) *** 125,129 **** } /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ --- 125,129 ---- } /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail unaligned_stack } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: testsuite/gcc.dg/vect/vect-18.c =================================================================== *** testsuite/gcc.dg/vect/vect-18.c (revision 128976) --- testsuite/gcc.dg/vect/vect-18.c (working copy) *************** int main (void) *** 124,128 **** } /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ --- 124,128 ---- } /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail unaligned_stack } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: testsuite/gcc.dg/vect/vect-2.c =================================================================== *** testsuite/gcc.dg/vect/vect-2.c (revision 128976) --- testsuite/gcc.dg/vect/vect-2.c (working copy) *************** int main (void) *** 35,39 **** } /* { 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 { cleanup-tree-dump "vect" } } */ --- 35,39 ---- } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail unaligned_stack } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: testsuite/gcc.dg/vect/vect-27.c =================================================================== *** testsuite/gcc.dg/vect/vect-27.c (revision 128976) --- testsuite/gcc.dg/vect/vect-27.c (working copy) *************** int main (void) *** 42,49 **** } /* The initialization induction loop (with aligned access) is also vectorized. */ ! /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail vect_no_align } } } */ ! /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_no_align } } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */ ! /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ --- 42,47 ---- } /* The initialization induction loop (with aligned access) is also vectorized. */ ! /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail { vect_no_align || { unaligned_stack && {! vector_alignment_reachable } } } } } } */ ! /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" {target { {! vect_no_align} && { unaligned_stack && {! vector_alignment_reachable } } } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: testsuite/gcc.dg/vect/vect-19.c =================================================================== *** testsuite/gcc.dg/vect/vect-19.c (revision 128976) --- testsuite/gcc.dg/vect/vect-19.c (working copy) *************** int main (void) *** 124,128 **** } /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ --- 124,128 ---- } /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail unaligned_stack } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: testsuite/gcc.dg/vect/vect-3.c =================================================================== *** testsuite/gcc.dg/vect/vect-3.c (revision 128976) --- testsuite/gcc.dg/vect/vect-3.c (working copy) *************** int main (void) *** 46,50 **** } /* { 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 { cleanup-tree-dump "vect" } } */ --- 46,50 ---- } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail unaligned_stack } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: testsuite/gcc.dg/vect/vect-20.c =================================================================== *** testsuite/gcc.dg/vect/vect-20.c (revision 128976) --- testsuite/gcc.dg/vect/vect-20.c (working copy) *************** int main (void) *** 96,100 **** } /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ --- 96,100 ---- } /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail unaligned_stack } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: testsuite/gcc.dg/vect/vect-4.c =================================================================== *** testsuite/gcc.dg/vect/vect-4.c (revision 128976) --- testsuite/gcc.dg/vect/vect-4.c (working copy) *************** int main (void) *** 36,40 **** } /* { 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 { cleanup-tree-dump "vect" } } */ --- 36,40 ---- } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail unaligned_stack } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: testsuite/gcc.dg/vect/vect-21.c =================================================================== *** testsuite/gcc.dg/vect/vect-21.c (revision 128976) --- testsuite/gcc.dg/vect/vect-21.c (working copy) *************** int main (void) *** 124,129 **** } /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail *-*-* } } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ --- 124,129 ---- } /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail *-*-* } } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail unaligned_stack } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: testsuite/gcc.dg/vect/vect-29.c =================================================================== *** testsuite/gcc.dg/vect/vect-29.c (revision 128976) --- testsuite/gcc.dg/vect/vect-29.c (working copy) *************** int main (void) *** 49,55 **** /* The initialization induction loop (with aligned access) is also vectorized. */ /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */ ! /* { 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." 1 "vect" {target vect_no_align } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ --- 49,55 ---- /* The initialization induction loop (with aligned access) is also vectorized. */ /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */ ! /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { {unaligned_stack && vector_alignment_reachable } && {! vect_no_align} } } } } */ ! /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {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 } } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: testsuite/gcc.dg/vect/vect-13.c =================================================================== *** testsuite/gcc.dg/vect/vect-13.c (revision 128976) --- testsuite/gcc.dg/vect/vect-13.c (working copy) *************** int main (void) *** 38,42 **** } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_int_max } } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ --- 38,42 ---- } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_int_max } } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail unaligned_stack } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: testsuite/gcc.dg/vect/vect-5.c =================================================================== *** testsuite/gcc.dg/vect/vect-5.c (revision 128976) --- testsuite/gcc.dg/vect/vect-5.c (working copy) *************** int main (void) *** 53,57 **** } /* { 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 { cleanup-tree-dump "vect" } } */ --- 53,57 ---- } /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail unaligned_stack } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: testsuite/gcc.dg/vect/vect-22.c =================================================================== *** testsuite/gcc.dg/vect/vect-22.c (revision 128976) --- testsuite/gcc.dg/vect/vect-22.c (working copy) *************** int main (void) *** 121,126 **** } /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ --- 121,126 ---- } /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail unaligned_stack } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: testsuite/gcc.dg/vect/vect-6.c =================================================================== *** testsuite/gcc.dg/vect/vect-6.c (revision 128976) --- testsuite/gcc.dg/vect/vect-6.c (working copy) *************** int main (void) *** 54,58 **** } /* { 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 { cleanup-tree-dump "vect" } } */ --- 54,58 ---- } /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail unaligned_stack } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: testsuite/gcc.dg/vect/vect-7.c =================================================================== *** testsuite/gcc.dg/vect/vect-7.c (revision 128976) --- testsuite/gcc.dg/vect/vect-7.c (working copy) *************** int main (void) *** 48,52 **** /* Fails for 32-bit targets that don't vectorize PLUS. */ /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail *-*-* } } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ --- 48,52 ---- /* Fails for 32-bit targets that don't vectorize PLUS. */ /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail *-*-* } } } */ ! /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail unaligned_stack } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: testsuite/lib/target-supports.exp =================================================================== *** testsuite/lib/target-supports.exp (revision 128976) --- testsuite/lib/target-supports.exp (working copy) *************** proc check_effective_target_vect_unpack *** 2107,2112 **** --- 2107,2133 ---- return $et_vect_unpack_saved } + # Return 1 if the target plus current options does not guarantee + # that its STACK_BOUNDARY is >= the reguired vector alignment. + # + # This won't change for different subtargets so cache the result. + + proc check_effective_target_unaligned_stack { } { + global et_unaligned_stack_saved + + if [info exists et_unaligned_stack_saved] { + verbose "check_effective_target_unaligned_stack: using cached result" 2 + } else { + set et_unaligned_stack_saved 0 + if { ( [istarget i?86-*-*] || [istarget x86_64-*-*] ) + && (! [istarget *-*-darwin*] ) } { + set et_unaligned_stack_saved 1 + } + } + verbose "check_effective_target_unaligned_stack: returning $et_unaligned_stack_saved" 2 + return $et_unaligned_stack_saved + } + # Return 1 if the target plus current options does not support a vector # alignment mechanism, 0 otherwise. # Index: tree-vectorizer.c =================================================================== *** tree-vectorizer.c (revision 128976) --- tree-vectorizer.c (working copy) *************** vect_can_force_dr_alignment_p (const_tre *** 1606,1617 **** if (TREE_STATIC (decl)) return (alignment <= MAX_OFILE_ALIGNMENT); else ! /* This is not 100% correct. The absolute correct stack alignment ! is STACK_BOUNDARY. We're supposed to hope, but not assume, that ! PREFERRED_STACK_BOUNDARY is honored by all translation units. ! However, until someone implements forced stack alignment, SSE ! isn't really usable without this. */ ! return (alignment <= PREFERRED_STACK_BOUNDARY); } --- 1606,1612 ---- if (TREE_STATIC (decl)) return (alignment <= MAX_OFILE_ALIGNMENT); else ! return (alignment <= STACK_BOUNDARY); }