aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr112924.c
blob: c8a51d40b82b73312e2ffb55aedf4b8a9fabe49f (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
/* PR tree-optimization/112924 */
/* { dg-do compile } */
/* { dg-options "-O2 -w" } */
/* { dg-additional-options "-msse2" { target i?86-*-* x86_64-*-* } } */

struct S { long a; char b[64]; };
void foo (struct S a);
char c;
int d[3541];

static void
bar (struct S *s, char *p)
{
  unsigned int a = sizeof (d) - sizeof (int) - s->a;
  long c = __builtin_object_size (s, 0);
  for (; a >= 64; a -= 64, p += 4);
    __builtin___memcpy_chk (s, p, a, c);
}

void
baz (void)
{
  struct S s = {};
  bar (&s, &c);
  foo (s);
}