Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site dataio.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!houxm!vax135!cornell!uw-beaver!uw-june!entropy!dataio!bright
From: bright@dataio.UUCP (Emperor)
Newsgroups: net.lang.c
Subject: Re: Using &LABEL
Message-ID: <191@dataio.UUCP>
Date: Tue, 18-Sep-84 12:52:50 EDT
Article-I.D.: dataio.191
Posted: Tue Sep 18 12:52:50 1984
Date-Received: Tue, 25-Sep-84 08:38:28 EDT
References: rabbit.3115, <3185@ecsvax.UUCP> <9406@brunix.UUCP>, <15@tikal.UUCP>
Organization: Data I/O, Redmond, WA
Lines: 16

I have looked at a number of C compilers (approx. 10), and all of them
generated jump tables for switch statements under the right conditions.
These conditions are generally:
	(max case value - min case value)
	--------------------------------- < (some small constant)
	(total number of cases)

	and (total number of cases) < (another small constant)

When this relation was not true, one of the following algorithms
was generated:
	a sequence of compare-branches
	a table of values and corresponding addresses was searched
	a hard-coded binary tree search
The compilers I looked at included various unix compilers and microprocessor
compilers.