aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/pr51590.c
blob: 55757ecbd4c2f486e3ab8a015435a9f10a1203a1 (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
/* PR middle-end/51590 */
/* { dg-do compile } */

struct S { long a, b; };

extern void baz (char *);

static void
bar (struct S *x)
{
  char c[8];
  int i;

  for (i = 0; i < 8; i++)
    c[i] = x->a >> ((7 - i) * 8);

  baz (c);
}

void
foo (const char *x, struct S *y)
{
  struct S d = *y;
  int i;

  for (i = 0; *x; x++)
    i++;

  if (i != 1)
    return;

  bar (&d);
}