Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site lsuc.UUCP Path: utzoo!utcs!lsuc!dave From: dave@lsuc.UUCP (David Sherman) Newsgroups: net.lang.c Subject: Re: the C switch Message-ID: <498@lsuc.UUCP> Date: Mon, 11-Mar-85 13:11:03 EST Article-I.D.: lsuc.498 Posted: Mon Mar 11 13:11:03 1985 Date-Received: Mon, 11-Mar-85 14:42:05 EST References: <800006@acf4.UUCP> <8874@brl-tgr.ARPA> Reply-To: dave@lsuc.UUCP (David Sherman) Organization: Law Society of Upper Canada, Toronto Lines: 14 Summary: algorithms are described in UNIX Review Feb/March 1984 > Do any C compilers perform switch optimization? I.e. tradeoff cascaded if > for table lookup. The code generation algorithms (three of them) are described in an article by LeRoy Fundingsland, "Code Generation for the ``Switch'' By the Version 7 C Compiler" which appears in UNIX Review, Feb-March 1984 (vol. 2 #1), pp. 94-100 and 123. I found it very instructive. Dave Sherman Toronto -- {utzoo pesnta nrcaero utcs hcr}!lsuc!dave {allegra decvax ihnp4 linus}!utcsri!lsuc!dave