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

void *foo (int *p)
{
  void *q;
  /* We should be able to DSE this store (p may point to errno).  */
  *p = 0;
  q = __builtin_malloc (4);
  *p = 0;
  return q;
}

int j;
void bar (int *i)
{
  /* This store is dead as well.  */
  j = 1;
  *i = 0;
  j = 2;
}

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