Debian Codegraph @

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

raw
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
3
4 #include <stdarg.h>
5 #include "tree-vect.h"
6
7 #if VECTOR_BITS > 256
8 #define NINTS (VECTOR_BITS / 32)
9 #else
10 #define NINTS 8
11 #endif
12
13 #define N (NINTS * 2)
14
15 __attribute__ ((noinline))
16 int main1 (int a, int b)
17 {
18 int i, j;
19 int ia[N][4][N + NINTS];
20
21 /* Multidimensional array. Aligned. The "inner" dimensions
22 are invariant in the inner loop. Store.
23 Not vectorizable: unsupported operation. */
24 for (i = 0; i < N; i++)
25 {
26 for (j = 0; j < N; j++)
27 {
28 ia[i][1][j + NINTS] = (a == b);
29 }
30 }
31
32 /* check results: */
33 for (i = 0; i < N; i++)
34 {
35 #pragma GCC novector
36 for (j = 0; j < N; j++)
37 {
38 if (ia[i][1][j + NINTS] != (a == b))
39 abort();
40 }
41 }
42
43 return 0;
44 }
45
46 int main (void)
47 {
48 check_vect ();
49
50 return main1 (2 ,7);
51 }
52
53 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
54 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
55 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */