gcc/testsuite/gcc.dg/tree-ssa/alias-37.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -fdump-tree-dse1-details" } */ |
| 3 | |
| 4 | int i; |
| 5 | int *foo (int bogus, int n) |
| 6 | { |
| 7 | int a[n]; |
| 8 | a[2] = bogus; /* Should elide this store since a cannot escape. */ |
| 9 | int *p; |
| 10 | if (bogus) |
| 11 | p = &a[2]; |
| 12 | else |
| 13 | p = &i; |
| 14 | return p; /* { dg-warning "\\\[-Wreturn-local-addr" } */ |
| 15 | } |
| 16 | |
| 17 | /* { dg-final { scan-tree-dump "Deleted dead store" "dse1" } } */ |