Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!nike!sri-spam!parcvax!hplabs!hp-sdd!ncr-sd!ncrcae!ncsu!uvacs!edison!jso From: jso@edison.UUCP (John Owens) Newsgroups: net.lang.c Subject: Re: Generating code for the switch statement Message-ID: <840@edison.UUCP> Date: Thu, 14-Aug-86 18:13:49 EDT Article-I.D.: edison.840 Posted: Thu Aug 14 18:13:49 1986 Date-Received: Sun, 17-Aug-86 05:49:12 EDT References: <15093@ucbvax.BERKELEY.EDU> <2765@brl-smoke.ARPA> <610@hropus.UUCP> Organization: General Electric Company, Charlottesville, VA Lines: 15 Summary: There is a compiler which does both code and branch tables. In article <610@hropus.UUCP>, ka@hropus.UUCP (Kenneth Almquist) writes: > If the cases are not consecutive, the branch table must be filled with > entries for the "missing" cases, making the table larger. [....] If > the cases are mostly consecutive with a few outliers, a branch table > could be augmented with a few specific tests for the outliers, but I > don't know of any compiler that does this. The Microsoft Pascal/Fortran compilers, at least some of the old ones (3.04 and 3.11) do this. I haven't tried it to see if their wonderful new code generators do. John Owens @ General Electric Company (+1 804 978 5726) jso%edison.UUCP@seismo.CSS.GOV [arpa] jso@edison.UUCP [w/ uucp domains] {cbosgd allegra ncsu xanth}!uvacs!edison!jso [roll your own]