aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c
blob: d3986f5ba17723e59a4effb6016a0d3e35003918 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* { dg-do compile } */
/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1-stats" } */

union loc {
    unsigned reg;
    signed offset;
};
void __frame_state_for2 (volatile char *state_in)
{
    union loc fs;
    {
	*state_in = fs.reg;
	*state_in = fs.offset;
    }
}
void __frame_state_for1 (volatile char *state_in)
{
    union loc fs;
    for (;;)
    {
	*state_in = fs.offset;
	*state_in = fs.reg;
    }
}

/* { dg-final { scan-tree-dump-times "Eliminated: 2" 2 "fre1" } } */
/* { dg-final { scan-tree-dump-times "Insertions: 1" 2 "fre1" } } */
/* { dg-final { cleanup-tree-dump "fre1" } } */