This was spurred a bit by the need to fix 67892, which is a problem with the old threader's support for threading across backedges. I've indicated in the past that I'd like to simply drop that code. It's fragile and generally just a PITA. The functionality would be replaced by Sebastian's FSM jump threading code. Sebastian's code should also form the basis for a jump threader that operates independently of DOM/VRP with the ultimate goal of totally dropping the old threader. That's obviously further out, but that's where I'm going. There are things Sebastian's code doesn't handle, some of which I already know how to fix, some of which are still TBD. But there's no reason to not start this process. The first step in my mind is to get Sebastian's code factored out of tree-ssa-threadedge.c. tree-ssa-threadedge.c will still use a single entry point in Sebastian's code during the transition. That single entry point can also be used by a distinct jump threading pass (I've already done this as a proof of concept locally). Once factored out, I can start enhancing Sebastian's code under the hood to start handling the missing cases with an eye towards handling enough cases that I can remove the old threader's support for threading across backedges (thus fixing 67892 along the way). This patch strictly moves bits out of tree-ssa-threadedge.c into a new file tree-ssa-threadbackwards.[ch] and minimizes the headers included by tree-ssa-threadedge.c. I chose "backwards" over "fsm" as I see this going to a place that is far more general than the FSM optimization, basically a backwards walking jump threader. The patch changes no logic or even the "fsm" references in the existing code. Bootstrapped and regression tested on x86_64-linux-gnu. Installed on the trunk. jeff