Debian Codegraph @

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

raw
1 /* Disabling epilogues until we find a better way to deal with scans. */
2 /* { dg-additional-options "--param vect-epilogues-nomask=0 -fdump-tree-optimized-details-blocks" } */
3 /* { dg-require-effective-target vect_int } */
4 /* { dg-add-options bind_pic_locally } */
5
6 #include <stdarg.h>
7 #include "tree-vect.h"
8
9 #define N 128
10 #define OFF 3
11
12 /* unaligned load. */
13
14 int ia[N];
15 int ib[N+OFF];
16
17 __attribute__ ((noinline))
18 int main1 (int off)
19 {
20 int i;
21
22 for (i = 0; i < N+OFF; i++)
23 {
24 ib[i] = i;
25 }
26
27 for (i = 0; i < N; i++)
28 {
29 ia[i] = ib[i+off];
30 }
31
32 /* check results: */
33 #pragma GCC novector
34 for (i = 0; i < N; i++)
35 {
36 if (ia[i] != ib[i+off])
37 abort ();
38 }
39
40 return 0;
41 }
42
43 int main (void)
44 {
45 check_vect ();
46
47 main1 (0); /* aligned */
48 main1 (OFF); /* unaligned */
49 return 0;
50 }
51
52 /* For targets that don't support misaligned loads we version for the load.
53 (The store is aligned). */
54
55 /* The initialization induction loop (with aligned access) is also vectorized. */
56 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
57 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */
58 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
59 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" {target { vect_no_align && { ! vect_hw_misalign } } } } } */
60 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */