summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-24.c
blob: 705993a4fb3ed0d600b4017fc57c6baa2b78b549 (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
/* { dg-do compile } */
/* { dg-options "-O -fno-tree-sra -fdump-tree-fre" } */

int foo(void)
{
  int a[16] = {};
  return a[3];
}

int bar(void)
{
  int a[16];
  __builtin_memset (a, 0, sizeof(a));
  return a[3];
}

struct X { int i; };
int baz(void)
{
  struct X a,b;
  a.i = 0;
  b = a;
  return b.i;
}

int bazzoo (void)
{
  struct X b, a = {};
  b = a;
  return b.i;
}

/* { dg-final { scan-tree-dump-times "= 0;" 5 "fre" } } */
/* { dg-final { cleanup-tree-dump "fre" } } */