Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c

raw
1 /* { dg-do run { target vect_cmdline_needed } } */
2 /* { dg-options "-O2 -fno-tree-loop-distribute-patterns -ftree-vectorize -fdump-tree-vect-details -fvect-cost-model=dynamic" } */
3 /* { dg-additional-options "-mno-sse" { target { i?86-*-* x86_64-*-* } } } */
4
5 #include <stdlib.h>
6
7 #define N 128
8 #define OFF 3
9
10 /* unaligned store. */
11
12 int main_1 (int off)
13 {
14 int i;
15 char ia[N+OFF];
16
17 for (i = 0; i < N; i++)
18 {
19 ia[i+off] = 5;
20 }
21
22 /* check results: */
23 #pragma GCC novector
24 for (i = 0; i < N; i++)
25 {
26 if (ia[i+off] != 5)
27 abort ();
28 }
29
30 return 0;
31 }
32
33 static volatile int off = 1;
34
35 int main (void)
36 {
37 return main_1 (off);
38 }
39
40
41 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { avr-*-* pru-*-* } } } } } */
42 /* IBM Z does not require special alignment for vectorization. */
43 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! { arm*-*-* avr-*-* pru-*-* s390*-*-* } } } } } */
44 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { ! { arm*-*-* avr-*-* pru-*-* s390*-*-* } } } } } */