summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/dse.c
blob: 4a859ae03e7f18fd886f5beee24d456b9941812f (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
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-dse-details" } */

#define N 256

struct
{
  int x;
  int y;
} S[100];

int z[100];

int
foo (void)
{
  int i;
  int x, y;

  S[5].x = 0;
  S[5].y = 0;

  x = 5 + z[0];
  y = z[0];

  S[5].x = x;
  S[5].y = y;
}

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