diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-2.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-2.c new file mode 100644 index 00000000000..e264c50f920 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-2.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-pre-stats" } */ +int motion_test1(int data, int data_0, int data_3, int v) +{ + int i; + int t, u; + + if (data) + i = data_0 + data_3; + else { + v = 2; + i = 5; + } + t = data_0 + data_3; + u = i; + return v * t * u; +} +/* We should eliminate one computation of data_0 + data_3 along the + main path, causing one reload. */ +/* { dg-final { scan-tree-dump-times "Reloads:1" 1 "pre"} } */ |