[PATCH] Re-add calling emit_clobber in lower-subreg.cc's resolve_simple_move.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-70.c
blobb5e112d1f3dff1662d63edee8d39c65275340e95
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "--param vect-max-peeling-for-alignment=0 -fdump-tree-optimized-details-blocks" } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #if VECTOR_BITS > 128
8 #define NINTS (VECTOR_BITS / 32)
9 #else
10 #define NINTS 4
11 #endif
13 #define N (NINTS * 6)
15 /* Keep execution time down. */
16 #if N <= 24
17 #define OUTERN N
18 #else
19 #define OUTERN NINTS
20 #endif
22 struct s{
23 int m;
24 int n[4][4][N];
27 struct test1{
28 struct s a; /* array a.n is unaligned */
29 int b;
30 int c;
31 struct s e[N]; /* array e.n is aligned */
34 /* Avoid big local temporaries. */
35 #if NINTS > 8
36 struct test1 tmp1;
37 #endif
39 __attribute__ ((noinline))
40 int main1 ()
42 int i,j;
43 #if NINTS <= 8
44 struct test1 tmp1;
45 #endif
47 for (i = 0; i < OUTERN; i++)
48 for (j = NINTS - 1; j < N - NINTS + 1; j++)
50 tmp1.e[i].n[1][2][j] = 8;
53 /* check results: */
54 for (i = 0; i < OUTERN; i++)
55 #pragma GCC novector
56 for (j = NINTS - 1; j < N - NINTS + 1; j++)
58 if (tmp1.e[i].n[1][2][j] != 8)
59 abort ();
62 /* not consecutive, will use strided stores */
63 for (i = 0; i < OUTERN; i++)
64 for (j = NINTS - 1; j < N - NINTS + 1; j++)
66 tmp1.e[j].n[1][2][j] = 8;
69 /* check results: */
70 for (i = 0; i < OUTERN; i++)
71 #pragma GCC novector
72 for (j = NINTS - 1; j < N - NINTS + 1; j++)
74 if (tmp1.e[j].n[1][2][j] != 8)
75 abort ();
78 return 0;
81 int main (void)
83 check_vect ();
85 return main1 ();
88 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
89 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target {{! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
90 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */