summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-14.c
blob: 14234cc55fdf3eaa951f248be01c4935c10f0be5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-dse1-details" } */

struct A { char c[4]; } a, b;

void
f1 (void)
{
  a.c[2] = '\0';
  __builtin_memset (&a.c[1], 1, 2);
}

void
f2 (void)
{
  __builtin_memcpy (&a.c[0], "a", 1);
  __builtin_memcpy (&a, &b, 3);
}

/* { dg-final { scan-tree-dump-times "Deleted dead store" 2 "dse1" } } */