+ loop_iterator li;
+ struct loop *loop;
+ scev_initialize ();
+ if (mark_irreducible_loops ())
+ FOR_EACH_BB (bb)
+ {
+ edge_iterator ei;
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if ((e->flags & EDGE_DFS_BACK)
+ && (e->flags & EDGE_IRREDUCIBLE_LOOP))
+ {
+ if (dump_file)
+ fprintf (dump_file, "Marking back edge of irreducible loop %i->%i\n",
+ e->src->index, e->dest->index);
+ mark_control_dependent_edges_necessary (e->dest, el);
+ }
+ }
+
+ FOR_EACH_LOOP (li, loop, 0)
+ if (!finite_loop_p (loop))
+ {
+ if (dump_file)
+ fprintf (dump_file, "can not prove finiteness of loop %i\n", loop->num);
+ mark_control_dependent_edges_necessary (loop->latch, el);
+ }
+ scev_finalize ();
+ }
+}
+
+
+/* Return true if REF is based on an aliased base, otherwise false. */
+
+static bool
+ref_may_be_aliased (tree ref)
+{
+ while (handled_component_p (ref))
+ ref = TREE_OPERAND (ref, 0);
+ return !(DECL_P (ref)
+ && !may_be_aliased (ref));
+}
+
+static bitmap visited = NULL;
+static unsigned int longest_chain = 0;
+static unsigned int total_chain = 0;
+static bool chain_ovfl = false;
+
+/* Worker for the walker that marks reaching definitions of REF,
+ which is based on a non-aliased decl, necessary. It returns
+ true whenever the defining statement of the current VDEF is
+ a kill for REF, as no dominating may-defs are necessary for REF
+ anymore. DATA points to cached get_ref_base_and_extent data for REF. */
+
+static bool
+mark_aliased_reaching_defs_necessary_1 (ao_ref *ref, tree vdef,
+ void *data ATTRIBUTE_UNUSED)
+{
+ gimple def_stmt = SSA_NAME_DEF_STMT (vdef);
+
+ /* All stmts we visit are necessary. */
+ mark_operand_necessary (vdef);
+
+ /* If the stmt lhs kills ref, then we can stop walking. */
+ if (gimple_has_lhs (def_stmt)
+ && TREE_CODE (gimple_get_lhs (def_stmt)) != SSA_NAME)
+ {
+ tree base, lhs = gimple_get_lhs (def_stmt);
+ HOST_WIDE_INT size, offset, max_size;
+ ao_ref_base (ref);
+ base = get_ref_base_and_extent (lhs, &offset, &size, &max_size);
+ /* We can get MEM[symbol: sZ, index: D.8862_1] here,
+ so base == refd->base does not always hold. */
+ if (base == ref->base)