Merge reload-branch up to revision 101000
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-dse-1.c
blobd0263e3a28760f280fa8ab5967d78c9dbe5a3745
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-dse1" } */
4 int
5 foo (int a, int b, int c)
7 int *p;
8 if (c)
9 p = &a;
10 else
11 p = &b;
13 *p = 3;
14 *p = 4;
15 return *p;
19 /* We should eliminate both assignments to *p. */
20 /* { dg-final { scan-tree-dump-times " = 3" 0 "dse1"} } */
21 /* { dg-final { scan-tree-dump-times " = 4" 0 "dse1"} } */
23 /* The return *p should be turned into return 4. */
24 /* { dg-final { scan-tree-dump-times " return 4" 1 "dse1"} } */
26 /* { dg-final { cleanup-tree-dump "dse1" } } */