+static int
+check_path_after_1 (struct et_occ *occ, int depth)
+{
+ int mn, m;
+
+ depth += occ->depth;
+ mn = depth;
+
+ if (occ->next)
+ {
+ m = check_path_after_1 (occ->next, depth);
+ if (m < mn)
+ mn = m;
+ }
+
+ len--;
+ gcc_assert (depths[len] == depth && datas[len] == occ->of);
+
+ if (occ->prev)
+ {
+ m = check_path_after_1 (occ->prev, depth);
+ if (m < mn)
+ mn = m;
+ }
+
+ gcc_assert (mn == occ->min + depth - occ->depth);
+
+ return mn;
+}
+
+/* Checks whether the path represented by a tree containing OCC was
+ not changed since the last recording. */
+
+static void
+check_path_after (struct et_occ *occ)
+{
+ while (occ->parent)
+ occ = occ->parent;
+
+ check_path_after_1 (occ, 0);
+ gcc_assert (!len);
+}
+
+#endif
+
+/* Splay the occurrence OCC to the root of the tree. */
+
+static void
+et_splay (struct et_occ *occ)
+{
+ struct et_occ *f, *gf, *ggf;
+ int occ_depth, f_depth, gf_depth;
+
+#ifdef DEBUG_ET
+ record_path_before (occ);
+ et_check_tree_sanity (occ);
+#endif
+
+ while (occ->parent)
+ {
+ occ_depth = occ->depth;
+
+ f = occ->parent;
+ f_depth = f->depth;
+
+ gf = f->parent;
+
+ if (!gf)