aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/alias-37.c
blob: c913d26d1323216245ee3cb420cb5669bdc27f61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* { dg-do compile } */
/* { dg-require-effective-target alloca } */
/* { dg-options "-O2 -fdump-tree-dse1-details" } */

int i;
int *foo (int bogus, int n)
{
  int a[n];
  a[2] = bogus; /* Should elide this store since a cannot escape.  */
  int *p;
  if (bogus)
    p = &a[2];
  else
    p = &i;
  return p;         /* { dg-warning "\\\[-Wreturn-local-addr" } */
}

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