This is the final patch which finally solves 71437. With the refactoring in place, this patch is quite trivial.
All we do is record conditions implied by ASSERT_EXPRs we encounter during the dominator walk. We also record implied conditions. So if we had a == 12 in the ASSERT_EXPR, we'll record a == 12, a >= 12 and a <= 12 as true in the available expression hash table. You get the idea.
Then in the threading simplification callback we first lookup the condition we want to simplify to see if it's in our hash table (via the ASSERT_EXPRs). And viola it all just works.
20040305-1.c is compromised by the improved jump threading in VRP. We thread jumps earlier which in turn allows if-combination to fire. Thankfully we can just test earlier (dce2).
ssa-dom-thread-4.c is slightly tweaked as we discover a jump threads earlier in VRP rather than in DOM. I've adjusted the expected outputs.
Bootstrapped and regression tested on top of patches #1-#3 on x86_64-linux-gnu and ppc64le-linux-gnu. Installing on the trunk.
Jeff