summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/pr42604.c
blob: 14f255a40a6939d211b7a5f1a20fb3b68fd3e0a6 (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
/* PR debug/42604 */
/* { dg-do compile } */
/* { dg-options "-O3 -ftree-vectorize -g -ffast-math" } */

unsigned *d;
unsigned short e;
int f;
float h[3][4];

void
test (unsigned short *b)
{
  int a, c, i;
  float g[3];
  unsigned j[32] = { 10, 0x63707274 };
  for (i = 0; i < (int) j[0]; i++)
    {
      j[i * 3 + 2] = d[0];
      d[0] += (j[i * 3 + 3] + 3) & -4;
    }
  for (a = 0; a < e; a++)
    {
      g[0] = g[1] = g[2] = 0;
      for (c = 0; c < f; c++)
	{
	  g[0] += h[0][c] * b[c];
	  g[1] += h[1][c] * b[c];
	}
      for (c = 0; c < 3; c++)
	b[c] = 0 > ((int) g[c] < 65535 ? ((int) g[c]) : 65535)
	  ? 0 : ((int) g[c]) < 65535 ? (int) g[c] : 65535;
    }
}

/* { dg-final { cleanup-tree-dump "vect" } } */