summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/loadpre3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/loadpre3.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/loadpre3.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre3.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre3.c
new file mode 100644
index 000000000..4bda8f644
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre3.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+int foo(int **a,int argc)
+{
+ int b;
+ int d, e;
+
+ if (argc)
+ {
+ d = *(*a);
+ }
+ else
+ {
+
+ }
+ /* Should be able to eliminate one of the *(*a)'s along the if path
+ by pushing it into the else path. We will also eliminate
+ one of the *a's. */
+ e = *(*a);
+ return d + e;
+}
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 2" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */