Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!lll-lcc!mordor!styx!ames!ucbcad!ucbvax!sdcsvax!sdchem!tps From: tps@sdchem.UUCP (Tom Stockfisch) Newsgroups: comp.lang.c Subject: Re: Long Branches Message-ID: <618@sdchema.sdchem.UUCP> Date: Tue, 20-Jan-87 20:12:57 EST Article-I.D.: sdchema.618 Posted: Tue Jan 20 20:12:57 1987 Date-Received: Wed, 21-Jan-87 06:41:21 EST References: <3950006@nucsrl.UUCP> <53900001@umn-cs.UUCP> Sender: news@sdchem.UUCP Reply-To: tps@sdchemf.UUCP (Tom Stockfisch) Organization: UC San Diego Lines: 19 In article <53900001@umn-cs.UUCP> herndon@umn-cs.UUCP (Robert Herndon) writes: >I've had this problem a few times. Try invoking the optimizer >on your file. The optimizer gets the assembly code before the >assembler does, recognizes that the branch is inappropriate >(or something, anyway) and generates an appropriate branch. Are you sure your optimizer isn't just optimizing away enough instructions to make the switch no longer span >64K bytes? I had the optimizer on a vax 4.2BSD system save me this way once. By the way, I don't think a huge switch is necessarily indicative of a poorly structured program. The switch could be the result of preprocessor replacement or be generated by another program such as yacc. In the program I wrote where I ran into this trouble my longest function consisted of 40 source code lines, and all the others were less than 20. The whole source file was ~250 lines (including copious comments), yet "cc" generated a ".s" file of 1.2 megabytes. || Tom Stockfisch, UCSD Chemistry tps%chem@sdcsvax.UCSD