Debian Codegraph @

gcc/testsuite/gcc.dg/vect/vect-28.c

raw
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "--param vect-max-peeling-for-alignment=0 -fdump-tree-optimized-details-blocks" } */
3
4 #include <stdarg.h>
5 #include "tree-vect.h"
6
7 #define N 128
8 #define OFF 3
9
10 /* unaligned store. */
11
12 __attribute__ ((noinline))
13 int main1 (int off)
14 {
15 int i;
16 int ia[N+OFF];
17
18 for (i = 0; i < N; i++)
19 {
20 ia[i+off] = 5;
21 }
22
23 /* check results: */
24 #pragma GCC novector
25 for (i = 0; i < N; i++)
26 {
27 if (ia[i+off] != 5)
28 abort ();
29 }
30
31 return 0;
32 }
33
34 int main (void)
35 {
36 check_vect ();
37
38 main1 (0); /* aligned */
39 main1 (OFF); /* unaligned */
40 return 0;
41 }
42
43 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
44 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
45 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */