Our local `lcc' compiler uses a combination of jump tables and
test-and-branch to implement switch statements. It uses jump tables for
dense portions of the switch statement, binary search elsewhere. The
example you show has three cases: 0, 10, and 31. It may be that gcc will
use a jump table if the cases are closer together. You might be able to
fool it by adding more cases, i.e., case 1: case 2: goto default_lab; and
so on.
--