blob: c913d26d1323216245ee3cb420cb5669bdc27f61 [file] [log] [blame]
/* { 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" } } */