aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr87126.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/pr87126.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr87126.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr87126.c b/gcc/testsuite/gcc.dg/tree-ssa/pr87126.c
new file mode 100644
index 00000000000..37232ba3a0a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr87126.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fre1" } */
+
+int a, *b;
+
+void f ()
+{
+ int d = 0, e = d;
+ while (a++)
+ ;
+ if (e)
+ goto L2;
+L1:
+ d = e;
+ b = &d;
+L2:
+ if (d)
+ goto L1;
+}
+
+/* The load of d could be eliminated if we'd value-number the
+ irreducible region in RPO of the reducible result. Likewise
+ a redundant store could be removed. */
+/* { dg-final { scan-tree-dump-times "d = 0;" 1 "fre1" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-not " = d;" "fre1" { xfail *-*-* } } } */