jakob@iar_.se (Jakob) writes:> >I have a number of different tactics for implementing a switch (among> >them a simple jump table and a series of conditional branches), and> >would like the compiler to make a semi-intelligent decision as to> >which to use for a particular switch.

[Sorry, I didn't see the original post]

In lcc they use conditional branches (laid out as a binary search tree) to
find which one of a set of compact jump tables to use. The code (and some
papers about the implementation) can be found at
<ftp://ftp.cs.princeton.edu/pub/packages/lcc/>, the book elaborates.