On Thu, Jul 28, 2016 at 11:46 PM, Patrick Palka <patr...@parcs.ath.cx> wrote: > This patch improves the forward jump threader's ability to thread > GIMPLE_SWITCHes by making the VRP simplification callback attempt to > determine which case label will be taken. > > For example, if the index operand of a switch has a value range ~[5,6] > along some edge and the switch statement has no "case 5" or "case 6" > label then this patch recognizes such a scenario as an opportunity for > threading through the switch and to the switch's default bb.
Uh, sorry, this example I gave is completely bogus... Given a value range of ~[5,6], "case 5" and "case 6" would have to be the only non-default labels in the switch for threading to occur, which is how the patch behaves.