aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/vect-67.c
blob: 08e58f96b73117e637f09d37876f013b3323839d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* { dg-require-effective-target vect_int } */
/* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */

#include <stdarg.h>
#include "tree-vect.h"

#if VECTOR_BITS > 256
#define NINTS (VECTOR_BITS / 32)
#else
#define NINTS 8
#endif

#define N (NINTS * 2)

__attribute__ ((noinline))
int main1 (int a, int b)
{
  int i, j;
  int ia[N][4][N + NINTS];

  /* Multidimensional array. Aligned. The "inner" dimensions
     are invariant in the inner loop. Store. 
     Not vectorizable: unsupported operation. */
  for (i = 0; i < N; i++)
    {
      for (j = 0; j < N; j++)
        {
           ia[i][1][j + NINTS] = (a == b);
        }
    }

  /* check results: */  
  for (i = 0; i < N; i++)
    {
#pragma GCC novector
      for (j = 0; j < N; j++)
        {
           if (ia[i][1][j + NINTS] != (a == b))
              abort();
        }
    }

  return 0;
}

int main (void)
{ 
  check_vect ();

  return main1 (2 ,7);
}

/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */
/* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */