aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/pr57915.c
blob: 0b143e0cc4bc210659e531d4f5e1d74b86276714 (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
/* PR rtl-optimization/57915 */
/* { dg-do compile } */
/* { dg-options "-Os" } */

extern struct T { char a[8]; char b[16]; } t;
int c;
void foo (void);

extern inline char *
baz (char *x, const char *y)
{
  const char *e = y;
  unsigned long f, g;
  asm ("" : "+c" (f), "+D" (e) : "a" ('\0'), "X" (*e));
  g = e - 1 - y;
  __builtin_memcpy (x, y, g);
  x[g] = '\0';
  return x;
}

void
bar (void)
{
  char d[16];
  baz (d, t.b);

  for (;;)
    {
      foo ();
      if (c)
	baz (d, t.b);
    }
}